From: Lutz Jänicke Date: Fri, 2 Mar 2007 17:46:25 +0000 (+0000) Subject: Do not use uninitialized memory to seed the PRNG as it may confuse X-Git-Tag: OpenSSL_0_9_8k^2~947 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c9fb4e2c8d2eabe732e1d1aabd9706d55980a4a4;p=oweals%2Fopenssl.git Do not use uninitialized memory to seed the PRNG as it may confuse code checking tools. PR: 1499 --- diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index 7533ea5788..43053b19bf 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -103,10 +103,8 @@ int RAND_load_file(const char *file, long bytes) if (file == NULL) return(0); #ifndef OPENSSL_NO_POSIX_IO - i=stat(file,&sb); - /* If the state fails, put some crap in anyway */ + if (stat(file,&sb) < 0) return(0); RAND_add(&sb,sizeof(sb),0.0); - if (i < 0) return(0); #endif if (bytes == 0) return(ret);