From ae21c03d6902e9e52e626f6230ce641e659efcb0 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 1 Mar 2018 10:03:20 -0700 Subject: [PATCH] check on certificate index when getting Name --- wolfcrypt/src/asn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index d71db8707..9d2e7f66b 100755 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4102,6 +4102,10 @@ static int GetName(DecodedCert* cert, int nameType) hash = cert->subjectHash; } + if (cert->srcIdx >= cert->maxIdx) { + return BUFFER_E; + } + if (cert->source[cert->srcIdx] == ASN_OBJECT_ID) { WOLFSSL_MSG("Trying optional prefix...");