fix buffer overflow

This commit is contained in:
Ray Lee 2021-08-24 10:43:32 +08:00
commit d6145d76e7

View file

@ -689,9 +689,10 @@ static int CmdHF14ADesInfo(const char *Cmd) {
iso14a_card_select_t card; iso14a_card_select_t card;
res = SelectCard14443A_4(true, false, &card); res = SelectCard14443A_4(true, false, &card);
if (res == PM3_SUCCESS) { if (res == PM3_SUCCESS) {
static const char STANDALONE_DESFIRE[] = { 0x75, 0x77, 0x81, 0x02}; // convert to str by adding \0 to the end. so we can use strlen() to calc length
static const char JCOP_DESFIRE[] = { 0x75, 0xf7, 0xb1, 0x02 }; static const char STANDALONE_DESFIRE[] = { 0x75, 0x77, 0x81, 0x02, '\0' };
static const char JCOP3_DESFIRE[] = { 0x78, 0x77, 0x71, 0x02 }; static const char JCOP_DESFIRE[] = { 0x75, 0xf7, 0xb1, 0x02, '\0' };
static const char JCOP3_DESFIRE[] = { 0x78, 0x77, 0x71, 0x02, '\0' };
if (card.sak == 0x20) { if (card.sak == 0x20) {