提交 c9fb4e2c 编写于 作者: L Lutz Jänicke

Do not use uninitialized memory to seed the PRNG as it may confuse

code checking tools.
PR: 1499
上级 6e7ca5e1
...@@ -103,10 +103,8 @@ int RAND_load_file(const char *file, long bytes) ...@@ -103,10 +103,8 @@ int RAND_load_file(const char *file, long bytes)
if (file == NULL) return(0); if (file == NULL) return(0);
#ifndef OPENSSL_NO_POSIX_IO #ifndef OPENSSL_NO_POSIX_IO
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);
#endif #endif
if (bytes == 0) return(ret); if (bytes == 0) return(ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册