projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e7ca5e
)
Do not use uninitialized memory to seed the PRNG as it may confuse
author
Lutz Jänicke
<jaenicke@openssl.org>
Fri, 2 Mar 2007 17:46:25 +0000
(17:46 +0000)
committer
Lutz Jänicke
<jaenicke@openssl.org>
Fri, 2 Mar 2007 17:46:25 +0000
(17:46 +0000)
code checking tools.
PR: 1499
crypto/rand/randfile.c
patch
|
blob
|
history
diff --git
a/crypto/rand/randfile.c
b/crypto/rand/randfile.c
index 7533ea57882dd7bf92891501adea50ce517a620c..43053b19bf8679b878d026760e5d5877fb715519 100644
(file)
--- 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);