GNOME Bugzilla – Bug 326605
Bad validation external entities with namespace declared in master document
Last modified: 2021-07-05 13:26:16 UTC
When I include xml document into another one as external entity, the namspace of parent element is not "propagate" to "externalExtity parser".
Created attachment 57157 [details] [review] Patch to this bug Please test carefully this patch because I am not "rock solid" in XML. Thanks
Created attachment 57158 [details] Some xml files to show this bug In the direcotory "orig" a original xml a DTD files wich are not valid. When a I remove namespaces (directory without_ns) the document is valid. When I manualy replace extrenal entity with content of include file (directory manual_include) the document is valid.
Created attachment 60064 [details] Simplier example of this bug
The patch is very buggy, looks like a memory corruptor, basically ctx->nsTab could be reallocated when grown up, and the original context would still use the old pointer. Namespace and DTDs and external parsed entities really don't mix well together. This is a libxml2 bug but fixing it would require major work not a 3 line patch really. Daniel
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.