From: Martin Holst Swende Date: Fri, 30 Jan 2015 14:18:18 +0000 (+0100) Subject: Merge pull request #53 from iceman1001/feature X-Git-Tag: v2.0.0-rc1~34 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/15491b2d7398eac88f2a83cab88fc771da4ced6c?hp=92623113b43d1f36cb72e61b8ce29ac74cf7db71 Merge pull request #53 from iceman1001/feature bounds check for loop - printDemodBuff --- diff --git a/client/cmddata.c b/client/cmddata.c index 8c91f0e1..25d752f6 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -56,6 +56,10 @@ void printDemodBuff() return; } if (bitLen>512) bitLen=512; //max output to 512 bits if we have more - should be plenty + + // ensure equally divided by 16 + bitLen &= 0xfff0; + for (i = 0; i <= (bitLen-16); i+=16) { PrintAndLog("%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i", DemodBuffer[i], @@ -188,6 +192,11 @@ void printBitStream(uint8_t BitStream[], uint32_t bitLen) return; } if (bitLen>512) bitLen=512; + + // ensure equally divided by 16 + bitLen &= 0xfff0; + + for (i = 0; i <= (bitLen-16); i+=16) { PrintAndLog("%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i", BitStream[i],