coolkey: Avoid success from init if there are no reasonable data raturned
Thanks to oss-fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18918 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18915
This commit is contained in:
parent
75847f4e93
commit
2c68c0662c
|
@ -2215,6 +2215,10 @@ static int coolkey_initialize(sc_card_t *card)
|
||||||
r = coolkey_list_object(card, COOLKEY_LIST_NEXT, &object_info);
|
r = coolkey_list_object(card, COOLKEY_LIST_NEXT, &object_info);
|
||||||
}
|
}
|
||||||
if (r != SC_ERROR_FILE_END_REACHED) {
|
if (r != SC_ERROR_FILE_END_REACHED) {
|
||||||
|
/* This means the card does not cooperate at all: bail out */
|
||||||
|
if (r >= 0) {
|
||||||
|
r = SC_ERROR_INVALID_CARD;
|
||||||
|
}
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
/* if we didn't pull the cuid from the combined object, then grab it now */
|
/* if we didn't pull the cuid from the combined object, then grab it now */
|
||||||
|
|
Loading…
Reference in New Issue