don't read past the cookie end

This commit is contained in:
Alexandre Ratchov 2011-05-06 12:12:25 +02:00
parent 190f1913a1
commit 681cac6593
1 changed files with 1 additions and 1 deletions

View File

@ -269,7 +269,7 @@ bad_gen:
}
len = AMSG_COOKIELEN;
while (len > 0) {
n = read(fd, cookie, AMSG_COOKIELEN);
n = read(fd, cookie, len);
if (n < 0) {
DPERROR(DEV_RANDOM);
close(fd);