mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Avoid infinite loop if read() fails consistently.
PR: misc/7926 Submitted by: Sergey Potapov <sp@alkor.ru>
This commit is contained in:
parent
83e2676ff1
commit
d26060f2e6
1 changed files with 1 additions and 1 deletions
|
|
@ -103,7 +103,7 @@ crc32(fd, cval, clen)
|
|||
|
||||
len = 0 ;
|
||||
crc32_total = ~crc32_total ;
|
||||
while ((nr = read(fd, buf, sizeof(buf))))
|
||||
while ((nr = read(fd, buf, sizeof(buf))) > 0)
|
||||
for (len += nr, p = buf; nr--; ++p) {
|
||||
CRC(crc, *p) ;
|
||||
CRC(crc32_total, *p) ;
|
||||
|
|
|
|||
Loading…
Reference in a new issue