Closed sam-itt closed 4 years ago
Couldn't use the pull request as my SVN repo is "master" here, but good catch, thanks. That flushbuffer in the switch should only trigger if there's a \n in there as well, so I fixed that together with the offset.
Great. In fact I would have sent you a patch but I couldn't find any directions on how to submit them on your website.
Never mind, pull requests are just fine. I wouldn't apply patches directly either; I review what the problem is and what my intentions were with the affected piece of code, and usually come up with other things to change as well, or sometimes a less invasive way to solve the problem. In any way, I usually resolve bugs by vim
, not by patch
. ;-)
Not resetting last seen '\n' offset after flushing the buffer (which resets the buffer index to 0) can lead to a situation where that offset has a higher value the the current buffer index, overflowing (unsigned) stream->bufidx = bufidx - offset and then doing a memmove of a gigantic size.