mirror of https://github.com/ericonr/sndio.git
don't read past the cookie end
This commit is contained in:
parent
190f1913a1
commit
681cac6593
|
@ -269,7 +269,7 @@ bad_gen:
|
||||||
}
|
}
|
||||||
len = AMSG_COOKIELEN;
|
len = AMSG_COOKIELEN;
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
n = read(fd, cookie, AMSG_COOKIELEN);
|
n = read(fd, cookie, len);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
DPERROR(DEV_RANDOM);
|
DPERROR(DEV_RANDOM);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
Loading…
Reference in New Issue