mirror of https://github.com/wolfSSL/wolfssl
sanity check on index before reading from input
This commit is contained in:
parent
ae21c03d69
commit
223facc46a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue