Skip to content

Commit

Permalink
EVP p_lib: Add NULL check to EVP_PKEY_missing_parameters.
Browse files Browse the repository at this point in the history
Check for NULL and return error if so.
This can possibly be called from apps/ca.c with a NULL argument.

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from #10474)
  • Loading branch information
paulidale committed Nov 21, 2019
1 parent 9bada85 commit ab5c77b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/evp/p_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from)

int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey)
{
if (pkey->ameth && pkey->ameth->param_missing)
if (pkey != NULL && pkey->ameth && pkey->ameth->param_missing)
return pkey->ameth->param_missing(pkey);
return 0;
}
Expand Down

0 comments on commit ab5c77b

Please sign in to comment.