[PATCH v3 3/3] xmllite: Expand test for any unparsed data at end of XML.

Nikolay Sivov nsivov at codeweavers.com
Fri Dec 6 16:18:46 CST 2019


On 12/7/19 12:24 AM, Jeff Smith wrote:
> On Fri, Dec 6, 2019 at 11:16 AM Nikolay Sivov <nsivov at codeweavers.com> wrote:
>> On 12/5/19 10:53 PM, Jeff Smith wrote:
>>> @@ -2662,7 +2663,7 @@ static HRESULT reader_parse_nextnode(xmlreader *reader)
>>>                hr = reader_parse_misc(reader);
>>>                if (hr != S_FALSE) return hr;
>>>
>>> -            if (*reader_get_ptr(reader))
>>> +            if (buffer->cur*sizeof(WCHAR) < buffer->written)
>>>                {
>>>                    WARN("found garbage in the end of XML\n");
>>>                    return WC_E_SYNTAX;
> Hi Nikolay,
>
>> That means we don't have enough data,
> How do you figure that?
>
>> it's another change not backed by tests
> This fixes two tests, and does not break any others.
>
>> and potentially depending on current read-ahead buffer size/filled level.
> I'm pretty sure reader_parse_misc would have read at least one byte
> ahead, which is all that is required for this to trigger, though I
> could double-check that.
> However, to your point made in the patch 2 of the set about not
> exposing the buffer at this level, I will also consider this something
> that potentially needs to be handled elsewhere.
My point is that we should always hit this single invalid syntax/garbage 
at the end condition that we already have,
instead of doing fixups for specific node types.
>
> Regards,
> Jeff




More information about the wine-devel mailing list