diff options
author | Mansour Ahmadi <m.ahmadi@northeastern.edu> | 2018-10-18 00:13:57 +0200 |
---|---|---|
committer | Nicola Tuveri <nic.tuv@gmail.com> | 2018-11-10 03:30:45 +0100 |
commit | d896b79b0994a35ecfd1c8e729d348d67236150e (patch) | |
tree | 8c6231038a447b60d92281472e23c9ece9f038d4 | |
parent | [crypto/bn] swap BN_FLG_FIXED_TOP too (diff) | |
download | openssl-d896b79b0994a35ecfd1c8e729d348d67236150e.tar.xz openssl-d896b79b0994a35ecfd1c8e729d348d67236150e.zip |
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)
-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) { |