mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
cppcheck out-of-bounds
This commit is contained in:
parent
16f5107915
commit
997567a9d6
1 changed files with 26 additions and 27 deletions
|
@ -238,7 +238,7 @@ int demodNexWatch(void) {
|
||||||
// output
|
// output
|
||||||
PrintAndLogEx(SUCCESS, " NexWatch raw id : " _YELLOW_("0x%"PRIx32) , rawid);
|
PrintAndLogEx(SUCCESS, " NexWatch raw id : " _YELLOW_("0x%"PRIx32) , rawid);
|
||||||
|
|
||||||
if (m_idx < 3) {
|
if (m_idx < ARRAYLEN(items)) {
|
||||||
PrintAndLogEx(SUCCESS, " fingerprint : " _GREEN_("%s"), items[m_idx].desc);
|
PrintAndLogEx(SUCCESS, " fingerprint : " _GREEN_("%s"), items[m_idx].desc);
|
||||||
}
|
}
|
||||||
PrintAndLogEx(SUCCESS, " 88bit id : " _YELLOW_("%"PRIu32) " (" _YELLOW_("0x%"PRIx32)")", cn, cn);
|
PrintAndLogEx(SUCCESS, " 88bit id : " _YELLOW_("%"PRIu32) " (" _YELLOW_("0x%"PRIx32)")", cn, cn);
|
||||||
|
@ -248,10 +248,10 @@ int demodNexWatch(void) {
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, " parity : %s (0x%X != 0x%X)", _RED_("fail"), parity, calc_parity);
|
PrintAndLogEx(WARNING, " parity : %s (0x%X != 0x%X)", _RED_("fail"), parity, calc_parity);
|
||||||
}
|
}
|
||||||
if (m_idx < 3) {
|
if (m_idx < ARRAYLEN(items)) {
|
||||||
PrintAndLogEx(SUCCESS, " checksum : %s (0x%02X)", _GREEN_("ok"), chk);
|
PrintAndLogEx(SUCCESS, " checksum : %s (0x%02X)", _GREEN_("ok"), chk);
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, " checksum : %s (0x%02X != 0x%02X)", _RED_("fail"), chk, items[m_idx].chk);
|
PrintAndLogEx(WARNING, " checksum : %s (0x%02X)", _RED_("fail"), chk);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " raw : " _YELLOW_("%"PRIX32"%"PRIX32"%"PRIX32), raw1, raw2, raw3);
|
PrintAndLogEx(INFO, " raw : " _YELLOW_("%"PRIX32"%"PRIX32"%"PRIX32), raw1, raw2, raw3);
|
||||||
|
@ -360,7 +360,6 @@ static int CmdNexWatchSim(const char *Cmd) {
|
||||||
int rawlen = sizeof(rawhex);
|
int rawlen = sizeof(rawhex);
|
||||||
uint8_t magic = 0xBE;
|
uint8_t magic = 0xBE;
|
||||||
uint32_t cn = 0;
|
uint32_t cn = 0;
|
||||||
|
|
||||||
uint8_t bs[128];
|
uint8_t bs[128];
|
||||||
memset(bs, 0, sizeof(bs));
|
memset(bs, 0, sizeof(bs));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue