muscle: Avoid access uninitialized memory

This commit is contained in:
Jakub Jelen 2019-11-14 11:18:11 +01:00 committed by Frank Morgner
parent 2c68c0662c
commit 7360c4bf0c
1 changed files with 1 additions and 1 deletions

View File

@ -93,7 +93,7 @@ static int muscle_match_card(sc_card_t *card)
apdu.resplen = 64;
apdu.resp = response;
r = sc_transmit_apdu(card, &apdu);
if (r == SC_SUCCESS && response[0] == 0x01) {
if (r == SC_SUCCESS && apdu.resplen > 1 && response[0] == 0x01) {
card->type = SC_CARD_TYPE_MUSCLE_V1;
} else {
card->type = SC_CARD_TYPE_MUSCLE_GENERIC;