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:42:29 +0200 |
commit | 98f62979b2e6233470619c9adfa44704a7036699 (patch) | |
tree | 4512ac11f575406864352a7ca7092a3d151e2be5 /apps | |
parent | 6f172154f5d389a9e52583c6564b2693cb631e7f (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)
(cherry picked from commit d896b79b0994a35ecfd1c8e729d348d67236150e)
Diffstat (limited to 'apps')
-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) { |