From 439b7ef4630009dec4c16ff957761194c7b47cf2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lutz=20J=C3=A4nicke?= Date: Fri, 16 May 2008 07:14:58 +0000 Subject: [PATCH] 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 :-) --- crypto/rand/randfile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index cec5880a8f..9b739f17e0 100644 --- 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) { -- 2.25.1