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:
a25fb95
)
Another occurance of possible valgrind/purify "uninitialized memory"
author
Lutz Jänicke
<jaenicke@openssl.org>
Fri, 16 May 2008 07:14:58 +0000
(07:14 +0000)
committer
Lutz Jänicke
<jaenicke@openssl.org>
Fri, 16 May 2008 07:14:58 +0000
(07:14 +0000)
complaint related to the PRNG: with PURIFY policy don't feed uninitialized
memory into the PRNG.
Submitted by: Bodo Moeller <bmoeller@openssl.org> :-)
crypto/rand/randfile.c
patch
|
blob
|
history
diff --git
a/crypto/rand/randfile.c
b/crypto/rand/randfile.c
index cec5880a8f477805578b00a9967deb527125d99d..9b739f17e0ba6c2b1b57fe5e9654c718115de2a8 100644
(file)
--- a/
crypto/rand/randfile.c
+++ b/
crypto/rand/randfile.c
@@
-127,7
+127,11
@@
int RAND_load_file(const char *file, long bytes)
i=fread(buf,1,n,in);
if (i <= 0) break;
/* even if n != i, use the full array */
+#ifdef PURIFY
+ RAND_add(buf,i,(double)i);
+#else
RAND_add(buf,n,(double)i);
+#endif
ret+=i;
if (bytes > 0)
{