forked from wolfSSL/wolfssl
sanity check on index before reading from input
This commit is contained in:
@ -2014,7 +2014,7 @@ WOLFSSL_LOCAL int GetAlgoId(const byte* input, word32* inOutIdx, word32* oid,
|
|||||||
return ASN_OBJECT_ID_E;
|
return ASN_OBJECT_ID_E;
|
||||||
|
|
||||||
/* could have NULL tag and 0 terminator, but may not */
|
/* 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);
|
ret = GetASNNull(input, &idx, maxIdx);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user