ParseCert: check index in DecodeSubtree before accessing tag

This commit is contained in:
Sean Parkinson
2022-01-24 12:30:48 +10:00
parent 198843aa34
commit 1dd213db76

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++];