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:
40ce8fc
)
PR: 2786
author
Dr. Stephen Henson
<steve@openssl.org>
Wed, 22 Aug 2012 22:43:03 +0000
(22:43 +0000)
committer
Dr. Stephen Henson
<steve@openssl.org>
Wed, 22 Aug 2012 22:43:03 +0000
(22:43 +0000)
Reported by: Tomas Mraz <tmraz@redhat.com>
Treat a NULL value passed to drbg_free_entropy callback as non-op. This
can happen if the call to fips_get_entropy fails.
crypto/rand/rand_lib.c
patch
|
blob
|
history
diff --git
a/crypto/rand/rand_lib.c
b/crypto/rand/rand_lib.c
index daf1dab9739590e409d7044aafd9e08c210accd2..476a0cd187ee7629526042e5de5728e6277a4b7c 100644
(file)
--- a/
crypto/rand/rand_lib.c
+++ b/
crypto/rand/rand_lib.c
@@
-210,8
+210,11
@@
static size_t drbg_get_entropy(DRBG_CTX *ctx, unsigned char **pout,
static void drbg_free_entropy(DRBG_CTX *ctx, unsigned char *out, size_t olen)
{
- OPENSSL_cleanse(out, olen);
- OPENSSL_free(out);
+ if (out)
+ {
+ OPENSSL_cleanse(out, olen);
+ OPENSSL_free(out);
+ }
}
/* Set "additional input" when generating random data. This uses the