muscle: Avoid access uninitialized memory
This commit is contained in:
parent
2c68c0662c
commit
7360c4bf0c
|
@ -93,7 +93,7 @@ static int muscle_match_card(sc_card_t *card)
|
||||||
apdu.resplen = 64;
|
apdu.resplen = 64;
|
||||||
apdu.resp = response;
|
apdu.resp = response;
|
||||||
r = sc_transmit_apdu(card, &apdu);
|
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;
|
card->type = SC_CARD_TYPE_MUSCLE_V1;
|
||||||
} else {
|
} else {
|
||||||
card->type = SC_CARD_TYPE_MUSCLE_GENERIC;
|
card->type = SC_CARD_TYPE_MUSCLE_GENERIC;
|
||||||
|
|
Loading…
Reference in New Issue