mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 10:36:58 -07:00
Update cmddata.c
as suggested, a bitwise bounds check in cmddata.
This commit is contained in:
parent
33c7e2f3bc
commit
0c5998c051
1 changed files with 7 additions and 3 deletions
|
@ -57,9 +57,8 @@ void printDemodBuff()
|
|||
}
|
||||
if (bitLen>512) bitLen=512; //max output to 512 bits if we have more - should be plenty
|
||||
|
||||
// equally divided by 16
|
||||
if ( bitLen % 16 > 0)
|
||||
bitLen = (bitLen/16);
|
||||
// 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",
|
||||
|
@ -193,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],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue