projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
RAND_add(): fix heap corruption in error path
[oweals/openssl.git]
/
crypto
/
rand
/
rand_lib.c
diff --git
a/crypto/rand/rand_lib.c
b/crypto/rand/rand_lib.c
index f40c513ce87683a13341cd2c5d3311982a9664fc..e6fcbce7fd8a60742334c13d952452e54fb54e15 100644
(file)
--- a/
crypto/rand/rand_lib.c
+++ b/
crypto/rand/rand_lib.c
@@
-200,6
+200,10
@@
size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
}
err:
+ /* we need to reset drbg->pool in the error case */
+ if (ret == 0 && drbg->pool != NULL)
+ drbg->pool = NULL;
+
rand_pool_free(pool);
return ret;
}