Title Out-of-bounds read in DilloPlain::write()
AuthorRodrigo Arias Mallo
CreatedSat, 17 Oct 2026 20:58:26 +0200
State open

From https://lists.mailman3.com/hyperkitty/list/dillo-dev@mailman3.com/message/Y53KPR4X6LRHP3B2GV2WH6HM2LSA6RI5/:

In src/plain.cc, \r\n sequences 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 \n if present. But if i + 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>