fixed Null-dereference READ

https://oss-fuzz.com/testcase-detail/5734505646391296

Thanks to OSS-Fuzz
This commit is contained in:
Frank Morgner 2019-10-26 23:50:11 +02:00
parent 61cd7fcdb2
commit 3c286b3cb1
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ int sc_asn1_read_tag(const u8 ** buf, size_t buflen, unsigned int *cla_out,
*buf = NULL;
if (left == 0)
if (left == 0 || !p)
return SC_ERROR_INVALID_ASN1_OBJECT;
if (*p == 0xff || *p == 0) {
/* end of data reached */