sanity check on input size

This commit is contained in:
Jacob Barthelmeh 2018-02-26 14:41:00 -07:00
parent 5ef4296b3d
commit e6c95a0854
1 changed files with 1 additions and 1 deletions

View File

@ -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;