sanity check before reading policy constraint

This commit is contained in:
JacobBarthelmeh
2021-12-13 14:32:46 -08:00
parent f5cd61e4f9
commit a2cf234100

View File

@ -14837,6 +14837,10 @@ static int DecodePolicyConstraints(const byte* input, int sz, DecodedCert* cert)
WOLFSSL_MSG("\tfail: skip value too big");
return BUFFER_E;
}
if (idx >= (word32)sz) {
WOLFSSL_MSG("\tfail: no policy const skip to read");
return BUFFER_E;
}
cert->policyConstSkip = input[idx];
return 0;