mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
fix out-of-bounds access
This commit is contained in:
parent
57f9a00906
commit
2f432788cf
1 changed files with 2 additions and 3 deletions
|
@ -2445,7 +2445,7 @@ static int CmdHF14ADesGetUID(const char *Cmd) {
|
|||
uint8_t uidlen = 16;
|
||||
|
||||
// Get datalen <uid len> + <crclen> by removing padding.
|
||||
while ((uidlen > 0) && (uid[uidlen] == 0x00))
|
||||
while ((uidlen > 0) && (uid[uidlen - 1] == 0x00))
|
||||
uidlen--;
|
||||
|
||||
if (tag->authentication_scheme == AS_LEGACY)
|
||||
|
@ -2455,10 +2455,9 @@ static int CmdHF14ADesGetUID(const char *Cmd) {
|
|||
|
||||
if (uidlen <= 4) // < incase we trimmed a CRC 00 or more
|
||||
uidlen = 4;
|
||||
else
|
||||
else
|
||||
uidlen = 7;
|
||||
|
||||
// PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(uid, sizeof(uid)));
|
||||
PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(uid, uidlen));
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue