| Title | Out-of-bounds read in DilloPlain::write() |
|---|---|
| Author | Rodrigo Arias Mallo |
| Created | Sat, 17 Oct 2026 20:58:26 +0200 |
| State | open |
In
src/plain.cc,\r\nsequences are handled with these lines:while ( i < MaxBytes ) { ... addLine(Start + i - len, len); if (Start[i] == '\r' && Start[i + 1] == '\n') ++i; if (i < MaxBytes) ++i; ...So if a \r occurs, skip over the
\nif present. But ifi + 1 == MaxBytes,Start[i + 1]is one past the end of the buffer, which is an out-of-bounds read. This happens if a file ends in\r, or I suppose if a file gets broken up and parsed with multiple invocations of the function. I think this could theoretically add a redundant line break to the rendered page.
Reported-by: 256 <256@256-32.com>