EGD bugfix.
Submitted by: Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>
This commit is contained in:
parent
cacbb51ee1
commit
fea217f96f
@ -162,7 +162,8 @@ long app_RAND_load_files(char *name)
|
|||||||
char *p,*n;
|
char *p,*n;
|
||||||
int last;
|
int last;
|
||||||
long tot=0;
|
long tot=0;
|
||||||
|
int egd;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
last=0;
|
last=0;
|
||||||
@ -173,7 +174,8 @@ long app_RAND_load_files(char *name)
|
|||||||
name=p+1;
|
name=p+1;
|
||||||
if (*n == '\0') break;
|
if (*n == '\0') break;
|
||||||
|
|
||||||
tot+=RAND_egd(n);
|
egd=RAND_egd(n);
|
||||||
|
if (egd > 0) tot+=egd;
|
||||||
tot+=RAND_load_file(n,1024L*1024L);
|
tot+=RAND_load_file(n,1024L*1024L);
|
||||||
if (last) break;
|
if (last) break;
|
||||||
}
|
}
|
||||||
|
@ -96,6 +96,7 @@ int RAND_egd(const char *path)
|
|||||||
buf[1] = 255;
|
buf[1] = 255;
|
||||||
write(fd, buf, 2);
|
write(fd, buf, 2);
|
||||||
if (read(fd, buf, 1) != 1) goto err;
|
if (read(fd, buf, 1) != 1) goto err;
|
||||||
|
if (buf[0] == 0) goto err;
|
||||||
num = read(fd, buf, 255);
|
num = read(fd, buf, 255);
|
||||||
if (num < 1) goto err;
|
if (num < 1) goto err;
|
||||||
RAND_seed(buf, num);
|
RAND_seed(buf, num);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user