Repository navigation
Compatibility: no public item changed (cargo-semver-checks against v0.3.27, default features: no semver update
required); the behaviour changes are the refusals and no-ops below.
Scope, now in the README: no safe method, and no unsafe fn whose contract is upheld, causes memory unsafety, with
libxml2 2.9 through 2.15. The documented exceptions are RoNode's validity (and a Namespace from an RoNode
outliving its document, for 0.4 with #239), threads, and leaks. No signature changed. A link add_child,
add_prev_sibling or add_next_sibling made before into an attribute's value, a DTD or a declaration returns Err
now (see Fixed); remove_property* on a DTD default, and set_name on a node libxml2 2.13 does not rename, return
Ok and change nothing.
Fixed
set_contentandset_text_contenton a processing instruction, a comment or a CDATA section keep its children,
as libxml2 2.13 and later do; before 2.13, libxml2 freed them, and their wrappers and namespaces pointed at freed
memory (#261, reported by fairfairfair-210).remove_property,remove_property_nsandremove_property_no_nsleave a property alone that only the DTD gives a
default value, and returnOk, asxmlUnsetPropdoes:xmlRemovePropread past the DTD's attribute table
(#262, reported by fairfairfair-210).get_property_node*still return such a default as its declaration, of type
AttributeDecl, which every method leaves alone or refuses; their documentation says so.- An attribute's value takes only text and entity references, as a DOM
Attr:add_childunder an attribute, and
the sibling adders next to one's value node, returnErrfor any other node. libxml2 freed an element there with
the value (set_property) or with the attribute (one of the same name added), and aNamespaceit declared
pointed at a freed namespace (#263, #264, reported by fairfairfair-210). A DTD takes only comments and processing
instructions besides its declarations, and a declaration no child or sibling but those: an element linked under a
declaration leaked, and one linked under the DTD or next to a declaration was written into the internal subset. set_namerenames only an element, an attribute, a processing instruction or an entity reference, as libxml2 2.13
and later do, and leaves any other node alone withOk: before 2.13, renaming an element declaration of a parsed
document freed a dictionary name when the document dropped (#265, reported by fairfairfair-210).Document::set_root_elementon aDocumentwithout a libxml2 document (from_raw_ptrof NULL) leaves the node
alone, where it read the NULL document for a text node, and marked an element linked (#266, reported by
fairfairfair-210).Node::canonicalizereturnsErr(())for a null node, a node libxml2 freed, and a node whoseDocumentwas dropped,
instead of panicking, or, for a freed node, canonicalizing nothing and returningOk("")(#267, reported by
fairfairfair-210).- A node whose
Documentwas dropped while it lived on no longer panics. Its child, sibling and parent getters
(get_first_child,get_child_nodesand the like) return none, andnew_childandadd_text_childreturnErr
without adding the child. Such a node is one made in aDocumentwithout a libxml2 document, which outlives the
Documentoncedup_fromgives it one.
Changed
- CI runs the test suite under valgrind with libxml2 2.12.9 too, the last version before 2.13's changes to
xmlNodeSetContentandxmlNodeSetName.