Skip to content

Commit

Permalink
Fix CIFuzz crash in starcos_has_esign_app()
Browse files Browse the repository at this point in the history
  • Loading branch information
jozsefd authored and Jakuje committed Jul 13, 2022
1 parent ca4d63e commit fa378da
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/libopensc/card-starcos.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,13 @@ static int starcos_has_esign_app(sc_card_t * card) {

rv = starcos_select_mf(card);
if ( rv == SC_SUCCESS ) {
sc_file_t * file;
u8 aid[SC_MAX_PATH_SIZE];
size_t len = sizeof(aid);

rv = sc_hex_to_bin(starcos_esign_aid, aid, &len);
LOG_TEST_RET(card->ctx, rv, "Failed to convert eSing AID");
rv = starcos_select_aid(card, aid, len, &file);
rv = starcos_select_aid(card, aid, len, NULL);
if ( rv == SC_SUCCESS ) {
sc_file_free(file);
starcos_select_mf(card);
}
}
Expand Down

0 comments on commit fa378da

Please sign in to comment.