summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2018-10-23 16:30:20 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2018-10-26 15:14:55 +0200
commit21311777ad8b8c2f2fb8eb7a4f9618ceae1e043d (patch)
tree1b451327f884610dea208fa616c2276596f7f2ad /crypto
parent41349b5e6dbd72bfbeaf3cf189d64914240628e3 (diff)
Fix a possible crash in rand_drbg_get_entropy
Reviewed-by: Paul Yang <yang.yang@baishancloud.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/7474)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/rand/rand_lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c
index e6fcbce7fd..29d93a829b 100644
--- a/crypto/rand/rand_lib.c
+++ b/crypto/rand/rand_lib.c
@@ -151,6 +151,8 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
pool->entropy_requested = entropy;
} else {
pool = rand_pool_new(entropy, min_len, max_len);
+ if (pool == NULL)
+ return 0;
}
if (drbg->parent) {