Fixed out of bounds access in ASN.1 Octet string

Credit to OSS-Fuzz
This commit is contained in:
Frank Morgner 2019-08-27 15:21:46 +02:00
parent 412a6142c2
commit a3fc7693f3
1 changed files with 1 additions and 1 deletions

View File

@ -1469,7 +1469,7 @@ static int asn1_decode_entry(sc_context_t *ctx,struct sc_asn1_entry *entry,
/* Strip off padding zero */
if ((entry->flags & SC_ASN1_UNSIGNED)
&& obj[0] == 0x00 && objlen > 1) {
&& objlen > 1 && obj[0] == 0x00) {
objlen--;
obj++;
}