From a3fc7693f3a035a8a7921cffb98432944bb42740 Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Tue, 27 Aug 2019 15:21:46 +0200 Subject: [PATCH] Fixed out of bounds access in ASN.1 Octet string Credit to OSS-Fuzz --- src/libopensc/asn1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libopensc/asn1.c b/src/libopensc/asn1.c index 296ad5ec..77ed4d7b 100644 --- a/src/libopensc/asn1.c +++ b/src/libopensc/asn1.c @@ -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++; }