Merge pull request #1213 from aveao/emrtd

emrtd: fix segfaults when debug print is enabled
This commit is contained in:
Iceman 2021-02-25 18:23:10 +01:00 committed by GitHub
commit be9ad747ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1798,7 +1798,7 @@ static int emrtd_print_ef_cardaccess_info(uint8_t *data, size_t datalen) {
}
for (int pacei = 0; pacealg_table[pacei].name != NULL; pacei++) {
PrintAndLogEx(DEBUG, "Trying: %s", hashalg_table[pacei].name);
PrintAndLogEx(DEBUG, "Trying: %s", pacealg_table[pacei].name);
if (memcmp(pacealg_table[pacei].descriptor, datafromtag, datafromtaglen) == 0) {
PrintAndLogEx(SUCCESS, "PACE algorithm........: " _YELLOW_("%s"), pacealg_table[pacei].name);
@ -1814,7 +1814,7 @@ static int emrtd_print_ef_cardaccess_info(uint8_t *data, size_t datalen) {
// TODO: hack!!!
memcpy(&parsednum, datafromtag, datafromtaglen);
for (int pacepari = 0; pacesdp_table[pacepari].id != 32; pacepari++) {
PrintAndLogEx(DEBUG, "Trying: %s", hashalg_table[pacepari].name);
PrintAndLogEx(DEBUG, "Trying: %s", pacesdp_table[pacepari].name);
if (pacesdp_table[pacepari].id == parsednum) {
PrintAndLogEx(SUCCESS, "PACE parameter........: " _YELLOW_("%s"), pacesdp_table[pacepari].name);