зеркало из https://github.com/github/putty.git
Reported by Tim Kosse: on Unix, read_random_seed() wasn't correctly checking
the return from open() and behaved wrongly in the absence of a seed file. [originally from svn r8517]
This commit is contained in:
Родитель
19e47863de
Коммит
542fc983bb
|
@ -638,7 +638,7 @@ void read_random_seed(noise_consumer_t consumer)
|
|||
fname = make_filename(INDEX_RANDSEED, NULL);
|
||||
fd = open(fname, O_RDONLY);
|
||||
sfree(fname);
|
||||
if (fd) {
|
||||
if (fd >= 0) {
|
||||
char buf[512];
|
||||
int ret;
|
||||
while ( (ret = read(fd, buf, sizeof(buf))) > 0)
|
||||
|
|
Загрузка…
Ссылка в новой задаче