mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-13 00:33:01 -07:00
Merge pull request #53 from iceman1001/feature
bounds check for loop - printDemodBuff
This commit is contained in:
commit
15491b2d73
1 changed files with 9 additions and 0 deletions
|
@ -56,6 +56,10 @@ void printDemodBuff()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (bitLen>512) bitLen=512; //max output to 512 bits if we have more - should be plenty
|
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) {
|
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",
|
PrintAndLog("%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i",
|
||||||
DemodBuffer[i],
|
DemodBuffer[i],
|
||||||
|
@ -188,6 +192,11 @@ void printBitStream(uint8_t BitStream[], uint32_t bitLen)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (bitLen>512) bitLen=512;
|
if (bitLen>512) bitLen=512;
|
||||||
|
|
||||||
|
// ensure equally divided by 16
|
||||||
|
bitLen &= 0xfff0;
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i <= (bitLen-16); i+=16) {
|
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",
|
PrintAndLog("%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i",
|
||||||
BitStream[i],
|
BitStream[i],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue