From: marshmellow42 Date: Mon, 10 Apr 2017 15:38:11 +0000 (-0400) Subject: fix length test X-Git-Tag: v3.0.0~16^2^2 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/refs/pull/274/head?ds=sidebyside fix length test thanks @pwpiwi for catching what i missed. --- diff --git a/client/cmddata.c b/client/cmddata.c index 2f508efc..823da9ce 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -40,8 +40,8 @@ void setDemodBuf(uint8_t *buff, size_t size, size_t startIdx) 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++){