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
commit ea2245c4d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;