Skip to content

Commit

Permalink
pkcs15-cflex: check path length to prevent underflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xhanulik authored and frankmorgner committed Jul 14, 2023
1 parent 6226a62 commit c449a18
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pkcs15init/pkcs15-cflex.c
Expand Up @@ -56,6 +56,9 @@ cflex_delete_file(sc_profile_t *profile, sc_pkcs15_card_t *p15card, sc_file_t *d
int r = 0;
/* Select the parent DF */
path = df->path;
if (path.len < 2) {
return SC_ERROR_INVALID_ARGUMENTS;
}
path.len -= 2;
r = sc_select_file(p15card->card, &path, &parent);
if (r < 0)
Expand Down

0 comments on commit c449a18

Please sign in to comment.