From f020b0f24a3cadd604e05c79f899bedc4bfc660a Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 15 Jun 2020 14:41:05 -0600 Subject: [PATCH] add check on decode subtree return value --- wolfcrypt/src/asn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 91cbab76e..38c853b4f 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -8408,7 +8408,10 @@ static int DecodeNameConstraints(const byte* input, int sz, DecodedCert* cert) return ASN_PARSE_E; } - DecodeSubtree(input + idx, length, subtree, cert->heap); + if (DecodeSubtree(input + idx, length, subtree, cert->heap) < 0) { + WOLFSSL_MSG("\terror parsing subtree"); + return ASN_PARSE_E; + } idx += length; }