On 12/08/2023 03:45, Michael Orlitzky wrote:
> The libsvgtiny test suite exposes two segfaults in libdom's libxml2
> parser. The first I'm somewhat confident in: linking dom/xml nodes
> can fail (or never happen), and if we encounter an unlinked node,
> something is wrong. Reasonable enough.
>
> The second was easy to fix, but I'm not as sure that the fix is
> correct. There's a branch where we jump to parent->children if we
> can't find an earlier element node, and in at least one case, there
> are no such children. Should there be? Adding a NULL check avoids a
> segfault, but maybe we should notice the problem sooner.
Thanks for these. I have not applied them, however, as the underlying
causes were failure to deal with a) errors within the libxml SAX
handlers and b) within the node addition logic. In either case, there is
no reasonable recovery path, so the parser should bail out, rather than
carrying on with undefined state. I've just pushed two changes to thie
binding that do this, and the libsvgtiny testsuite now passes happily
with libdom using libxml as its parser.
John-Mark.
_______________________________________________
netsurf-dev mailing list -- netsurf-dev@netsurf-browser.org
To unsubscribe send an email to netsurf-dev-leave@netsurf-browser.org
No comments:
Post a Comment