From c5ac2aa62c415ed0ba2f97ab1792a42ed0963425 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lutz=20J=C3=A4nicke?= Date: Fri, 2 Mar 2007 17:44:55 +0000 Subject: [PATCH] Do not use uninitialized memory to seed the PRNG as it may confuse code checking tools. PR: 1499 --- crypto/rand/randfile.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index d69bdf8b8a..cec5880a8f 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -102,10 +102,8 @@ int RAND_load_file(const char *file, long bytes) if (file == NULL) return(0); - 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); if (bytes == 0) return(ret); in=fopen(file,"rb"); -- 2.25.1