diff options
| author | 2026-11-05 10:44:41 +0100 | |
|---|---|---|
| committer | 2026-11-05 11:59:00 +0100 | |
| commit | f252f243f9774b2b830172b49aa340d6994d8081 (patch) | |
| tree | a7753a4fb73cabba3657f95460e80bbd5f2f314a /m4/cython_python.m4 | |
| parent | 3347d52167a36952666856c2b5ad2a5e9adda3a2 (diff) | |
| download | libplist-f252f243f9774b2b830172b49aa340d6994d8081.tar.gz libplist-f252f243f9774b2b830172b49aa340d6994d8081.tar.bz2 | |
xplist: fix double-free in node_from_xml() error paths
node_from_xml() hands a freshly created node over to the tree (as
root, or by adding it to a dict/array parent), but only reset `subnode`
at the very end of the block. If an error occurred in between, e.g. the
allocation of the node path item failing right after the root node was
assigned to *plist, err_out freed the node while the tree still
referenced it, and plist_free(*plist) then freed it a second time.
Clear `subnode` right after the node has been successfully attached so
that err_out can never free a node owned by the tree. Also report
PLIST_ERR_NO_MEM instead of PLIST_ERR_PARSE when allocating the node
path item fails.
Co-authored-by: bg0d-droid <81825610+bg0d-droid@users.noreply.github.com>
Diffstat (limited to 'm4/cython_python.m4')
0 files changed, 0 insertions, 0 deletions
