From 223facc46aa42383206ef3ffef6680d1229263a0 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 1 Mar 2018 18:03:21 -0700 Subject: [PATCH] sanity check on index before reading from input --- wolfcrypt/src/asn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 9d2e7f66b..e98816582 100755 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -2014,7 +2014,7 @@ WOLFSSL_LOCAL int GetAlgoId(const byte* input, word32* inOutIdx, word32* oid, return ASN_OBJECT_ID_E; /* could have NULL tag and 0 terminator, but may not */ - if (input[idx] == ASN_TAG_NULL) { + if (idx < maxIdx && input[idx] == ASN_TAG_NULL) { ret = GetASNNull(input, &idx, maxIdx); if (ret != 0) return ret;