projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ada5de7
)
Check for malloc failure in EVP_PKEY_keygen()
author
Matt Caswell
<matt@openssl.org>
Thu, 26 May 2016 14:54:48 +0000
(15:54 +0100)
committer
Matt Caswell
<matt@openssl.org>
Thu, 26 May 2016 15:13:08 +0000
(16:13 +0100)
After a call to EVP_PKEY_new() we should check for malloc failure.
RT#4180
Reviewed-by: Stephen Henson <steve@openssl.org>
crypto/evp/pmeth_gn.c
patch
|
blob
|
history
diff --git
a/crypto/evp/pmeth_gn.c
b/crypto/evp/pmeth_gn.c
index 6435f1b632cfe804c22057f985c73edbe2118c1e..6a4d3573ff7673314d45dd05c68abf19840184df 100644
(file)
--- a/
crypto/evp/pmeth_gn.c
+++ b/
crypto/evp/pmeth_gn.c
@@
-149,8
+149,10
@@
int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
if (!ppkey)
return -1;
- if (
!*ppkey
)
+ if (
*ppkey == NULL
)
*ppkey = EVP_PKEY_new();
+ if (*ppkey == NULL)
+ return -1;
ret = ctx->pmeth->keygen(ctx, *ppkey);
if (ret <= 0) {