Fix a possible crash in rand_drbg_get_entropy
[openssl.git] / crypto / rand / rand_lib.c
index e6fcbce7fd8a60742334c13d952452e54fb54e15..29d93a829bf60727daa317f508606fc5385d0755 100644 (file)
@@ -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) {