diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2021-03-13 18:41:47 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2021-03-13 18:46:00 +0100 |
commit | e20c9c148c725e2933efa143ee6a543a5cae4204 (patch) | |
tree | 9ca7175576705e94f333ef09f474de404f77d16f | |
parent | c3fd8c429591e06eb847c11bc9273d13b3450d53 (diff) | |
download | libxml2-e20c9c148c725e2933efa143ee6a543a5cae4204.tar.gz |
Fix xmlGetNodePath with invalid node types
Make xmlGetNodePath return NULL instead of invalid XPath when hitting
unsupported node types like DTD content.
Reported here:
https://mail.gnome.org/archives/xml/2021-January/msg00012.html
Original report:
https://bugs.php.net/bug.php?id=80680
-rw-r--r-- | tree.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -4893,7 +4893,9 @@ xmlGetNodePath(const xmlNode *node) } next = ((xmlAttrPtr) cur)->parent; } else { - next = cur->parent; + xmlFree(buf); + xmlFree(buffer); + return (NULL); } /* |