From e6c95a08540a59070da39e98553da873aa2eccc0 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Mon, 26 Feb 2018 14:41:00 -0700 Subject: [PATCH] sanity check on input size --- 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 2b2d7ad7b..11ef5b864 100755 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -11143,7 +11143,7 @@ int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx, inSz, key->heap, DYNAMIC_TYPE_ECC_BUFFER); } if (ret == 0) { - if (input[*inOutIdx] == ASN_BIT_STRING) { + if (*inOutIdx < inSz && input[*inOutIdx] == ASN_BIT_STRING) { len = 0; ret = GetASNHeader(input, ASN_BIT_STRING, inOutIdx, &len, inSz); *inOutIdx += len;