Merge pull request #4790 from SparkiDev/decodesubtree_oobr

ParseCert: check index in DecodeSubtree before accessing tag
This commit is contained in:
David Garske
2022-01-24 08:36:52 -08:00
committed by GitHub

View File

@@ -15968,6 +15968,12 @@ static int DecodeSubtree(const byte* input, int sz, Base_entry** head,
WOLFSSL_MSG("\tfail: should be a SEQUENCE");
return ASN_PARSE_E;
}
if (idx >= (word32)sz) {
WOLFSSL_MSG("\tfail: expecting tag");
return ASN_PARSE_E;
}
nameIdx = idx;
b = input[nameIdx++];