]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Merge pull request #53 from iceman1001/feature
authorMartin Holst Swende <martin@swende.se>
Fri, 30 Jan 2015 14:18:18 +0000 (15:18 +0100)
committerMartin Holst Swende <martin@swende.se>
Fri, 30 Jan 2015 14:18:18 +0000 (15:18 +0100)
bounds check for loop - printDemodBuff

client/cmddata.c

index 8c91f0e115ce84c7f6e934861e784d5341943215..25d752f6a47eacf28a7ca827011a2e6aee31de26 100644 (file)
@@ -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],
Impressum, Datenschutz