Merge pull request #4656 from JacobBarthelmeh/SanityChecks

sanity check before reading policy constraint
This commit is contained in:
David Garske
2021-12-16 08:42:19 -08:00
committed by GitHub

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;