diff options
author | Mansour Ahmadi <m.ahmadi@northeastern.edu> | 2018-10-17 18:13:57 -0400 |
---|---|---|
committer | Nicola Tuveri <nic.tuv@gmail.com> | 2018-11-10 04:30:45 +0200 |
commit | d896b79b0994a35ecfd1c8e729d348d67236150e (patch) | |
tree | 8c6231038a447b60d92281472e23c9ece9f038d4 /apps/rsa.c | |
parent | dd41956d80686638d74fd203bd67060f90966280 (diff) |
Check return value of EVP_PKEY_new
Reviewed-by: Paul Yang <yang.yang@baishancloud.com>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7427)
Diffstat (limited to 'apps/rsa.c')
-rw-r--r-- | apps/rsa.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/rsa.c b/apps/rsa.c index 5098a20dbc..fdd02dce32 100644 --- a/apps/rsa.c +++ b/apps/rsa.c @@ -269,6 +269,9 @@ int rsa_main(int argc, char **argv) } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); + if (pk == NULL) + goto end; + EVP_PKEY_set1_RSA(pk, rsa); if (outformat == FORMAT_PVK) { if (pubin) { |