What's Changed
New Features
- #970: Add
NsReader::resolver_mut()andNamespaceResolver::{max_declarations_per_element, set_max_declarations_per_element}.
Bug Fixes
- #969:
Attributes(and anything that iteratesBytesStart::attributes()with the defaultwith_checks(true)) no longer takes O(N²) time on a start tag with a large number of attributes. Small tags keep the previous linear scan; larger ones switch to a 64-bit hash pre-filter, so the whole tag is O(N). The exactAttrError::Duplicated(new, prev)positions are unchanged. - #970:
NamespaceResolver::push(and hence everyNsReaderStart/Emptyevent) now rejects a start tag that declares more thanDEFAULT_MAX_DECLARATIONS_PER_ELEMENT(256)xmlns/xmlns:*namespace bindings, returning the newNamespaceError::TooManyDeclarations. Previouslypushallocated oneNamespaceBindingper declaration with no upper bound, before the event was returned to the caller, so anNsReaderconsumer could not bound its memory exposure on untrusted input. The limit is configurable viaNamespaceResolver::set_max_declarations_per_element(useusize::MAXto disable).
New Contributors
- @qifan-sailboat made their first contribution in #972
Full Changelog: v0.40.1...v0.41.0