Revision Date Author Comments
# 1e949d18 04-Oct-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix edge-case in DOM parsing decoding

There are three connected subtle issues:
1) The fast path didn't correctly handle the case where the decoder
requests more data. This caused

Fix edge-case in DOM parsing decoding

There are three connected subtle issues:
1) The fast path didn't correctly handle the case where the decoder
requests more data. This caused a bogus additional replacement
sequence to be outputted when encountering an incomplete sequence at
the edges of a buffer.
2) The finishing of decoding incorrectly assumed that the fast path
cannot be in a state where the last few bytes were an incomplete
sequence, but this is not true as shown by test 08.
3) The finishing of decoding could output bytes twice because it called
into dom_process_parse_chunk() twice without clearing the decoded
data. However, calling twice is not even necessary as the entire
buffer cannot be filled up entirely.

Closes GH-16226.

show more ...