]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
fix length test 274/head
authormarshmellow42 <marshmellowrf@gmail.com>
Mon, 10 Apr 2017 15:38:11 +0000 (11:38 -0400)
committermarshmellow42 <marshmellowrf@gmail.com>
Mon, 10 Apr 2017 15:38:11 +0000 (11:38 -0400)
thanks @pwpiwi for catching what i missed.

client/cmddata.c

index 2f508efcc5744fb6da8f1c3f1c91ed95742ebf7f..823da9cef465da873660e1b147d4ea745bac91d2 100644 (file)
@@ -40,8 +40,8 @@ void setDemodBuf(uint8_t *buff, size_t size, size_t startIdx)
        if (buff == NULL) 
                return;
 
        if (buff == NULL) 
                return;
 
-       if ( size + startIdx >= MAX_DEMOD_BUF_LEN)
-               size = MAX_DEMOD_BUF_LEN;
+       if ( size > MAX_DEMOD_BUF_LEN - startIdx)
+               size = MAX_DEMOD_BUF_LEN - startIdx;
 
        size_t i = 0;
        for (; i < size; i++){
 
        size_t i = 0;
        for (; i < size; i++){
Impressum, Datenschutz