Don't skip the initialisation of tl->len when we hit an EOF immediately
after allocating a new buffer. This bug caused `tail -r < /dev/null' to core dump when the `J' malloc option is set, and also affected any other input that was an exact multiple of 128k.
This commit is contained in:
parent
c1249c6338
commit
2bcccc224c
@ -234,9 +234,8 @@ r_buf(FILE *fp)
|
||||
* If no input data for this block and we tossed some data,
|
||||
* recover it.
|
||||
*/
|
||||
if (!len) {
|
||||
if (enomem)
|
||||
enomem -= tl->len;
|
||||
if (!len && enomem) {
|
||||
enomem -= tl->len;
|
||||
tl = tl->prev;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user