Closed brooksdavis closed 1 year ago
I've not managed to figure out what the exact trigger is for the out of bounds read (I hit the error when editing over a laggy connections so not sure what state it was in), but I spent far too long staring at this code just to figure out what it was doing.
I see that memcpy() handles overlap on FreeBSD but given that nvi2 is built on other operating systems wouldn't it be more conservative to use memmove()?
Indeed, memmove is more correct.
I can't read the code, either. Thanks!
Replace a rather convoluted realignment algorithm with memcpy(). In addition to being hard to understand, the code would read beyond the end of the input buffer in certain conditions (found on CheriBSD).
Sponsored by: DARPA