sanity check on index before reading from input

This commit is contained in:
Jacob Barthelmeh 2018-03-01 18:03:21 -07:00
parent ae21c03d69
commit 223facc46a
1 changed files with 1 additions and 1 deletions

View File

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