Skip to content

Fix incorrect decreasing of nesting level in NamespaceResolver#974

Open
weiznich wants to merge 1 commit into
tafia:masterfrom
GiGainfosystems:fix/953
Open

Fix incorrect decreasing of nesting level in NamespaceResolver#974
weiznich wants to merge 1 commit into
tafia:masterfrom
GiGainfosystems:fix/953

Conversation

@weiznich

Copy link
Copy Markdown
Contributor

This commit fixes an incorrect decreasing of the nesting level in the NamespaceResolver through the ns_reader. We could end up there in a state where we request a future decreasing of the nesting level without pushing an actual increase. This could cause namespaces to be unregistered too early.

Fix #953

This commit fixes an incorrect decreasing of the nesting level in the
NamespaceResolver through the ns_reader. We could end up there in a
state where we request a future decreasing of the nesting level without
pushing an actual increase. This could cause namespaces to be
unregistered too early.

Fix tafia#953
Comment thread src/reader/ns_reader.rs
Comment on lines 93 to +97
Ok(Event::End(e)) => {
// push a fake element to the `ns_resolver` as the pending pop will remove it again
// if we don't push this element we don't increase the level, but the subsequent pending pop will
// decrease it anyway.
self.ns_resolver.push(&BytesStart::new(""))?;

@Mingun Mingun Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only mask the issue in some cases. As described, the root cause lies in the event rewind code, that does not save/restore snapshots of NamespaceResolver state. The correct fix should implement such snapshoting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

overlapped-lists feature causes parser errors to xsi:nil fields after array fields

2 participants