From: Lutz Jänicke Date: Fri, 16 May 2008 07:14:26 +0000 (+0000) Subject: Another occurance of possible valgrind/purify "uninitialized memory" X-Git-Tag: OpenSSL_0_9_8k^2~404 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8b99c79fae22f93319443d0bec7068dbc6dca968;p=oweals%2Fopenssl.git Another occurance of possible valgrind/purify "uninitialized memory" complaint related to the PRNG: with PURIFY policy don't feed uninitialized memory into the PRNG. Submitted by: Bodo Moeller :-) --- diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index 43053b19bf..7468eaa578 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -129,7 +129,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) {