Skip to content
Permalink
Browse files Browse the repository at this point in the history
iasecc: Prevent stack buffer overflow when empty ACL is returned
  • Loading branch information
Jakuje authored and frankmorgner committed Feb 25, 2021
1 parent 1252aca commit ae1cf0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libopensc/card-iasecc.c
Expand Up @@ -1171,7 +1171,7 @@ iasecc_process_fci(struct sc_card *card, struct sc_file *file,
else
acls = sc_asn1_find_tag(ctx, buf, buflen, IASECC_DOCP_TAG_ACLS_CONTACT, &taglen);

if (!acls) {
if (!acls || taglen < 7) {
sc_log(ctx,
"ACLs not found in data(%"SC_FORMAT_LEN_SIZE_T"u) %s",
buflen, sc_dump_hex(buf, buflen));
Expand Down

0 comments on commit ae1cf0b

Please sign in to comment.