Bug 288153
| Summary: | [XML Parser] Don't overwrite result of xmlGetPredefinedEntity | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | zak ridouh <zakr> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ddkilzer, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
zak ridouh
Currently, in `xmlGetPredefinedEntity` (Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:1262), we overwrite the value of `ent->etype`, which for xmlGetPredefinedEntity, should always be of type `XML_INTERNAL_PREDEFINED_ENTITY`
See: <https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/entities.c#L311> & <https://gitlab.gnome.org/GNOME/libxml2/-/blob/master/entities.c#L36>
We should just use a debug ASSERT to verify that the result has the expected type, and not overwrite it. Functionally, this should have 0 changes in behavior of our XML Parser, but allows these global types to be set to const in the libxml2 codebase.
The upstream maintainer of libxml2 attempted to make these globals `const` in a previous patch <https://gitlab.gnome.org/GNOME/libxml2/-/commit/63ce5f9aedccda737f5b25a28dba1fdeecbdbfc6> which he then reverted <https://gitlab.gnome.org/GNOME/libxml2/-/commit/f0d891585d63e380bf45044d4b5e535dc610871a> due to us and Chromium setting the value unnecessarily.
This does not currently impact our shipping software, but proactively prepares us for future versions, and changes in upstream.
Chromium also aligned their code here: <https://chromium-review.googlesource.com/c/chromium/src/+/5592393>
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/145249951>
zak ridouh
Pull request: https://github.com/WebKit/WebKit/pull/41013
EWS
Committed 290765@main (f337e8735a7d): <https://commits.webkit.org/290765@main>
Reviewed commits have been landed. Closing PR #41013 and removing active labels.