Skip to content

Commit

Permalink
param build: add errors to failure returns
Browse files Browse the repository at this point in the history
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from #17440)

(cherry picked from commit 3831351)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
  • Loading branch information
paulidale authored and t8m committed Nov 9, 2022
1 parent c737132 commit b08f61e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crypto/param_build.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ static int param_push_num(OSSL_PARAM_BLD *bld, const char *key,
{
OSSL_PARAM_BLD_DEF *pd = param_push(bld, key, size, size, type, 0);

if (pd == NULL)
if (pd == NULL) {
ERR_raise(ERR_LIB_CRYPTO, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
if (size > sizeof(pd->num)) {
ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_BYTES);
return 0;
Expand Down

0 comments on commit b08f61e

Please sign in to comment.