Do not use uninitialized memory to seed the PRNG as it may confuse
code checking tools. PR: 1499
This commit is contained in:
parent
392a0345de
commit
c5ac2aa62c
@ -102,10 +102,8 @@ int RAND_load_file(const char *file, long bytes)
|
|||||||
|
|
||||||
if (file == NULL) return(0);
|
if (file == NULL) return(0);
|
||||||
|
|
||||||
i=stat(file,&sb);
|
if (stat(file,&sb) < 0) return(0);
|
||||||
/* If the state fails, put some crap in anyway */
|
|
||||||
RAND_add(&sb,sizeof(sb),0.0);
|
RAND_add(&sb,sizeof(sb),0.0);
|
||||||
if (i < 0) return(0);
|
|
||||||
if (bytes == 0) return(ret);
|
if (bytes == 0) return(ret);
|
||||||
|
|
||||||
in=fopen(file,"rb");
|
in=fopen(file,"rb");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user