[libxml2] Fix xmlGetNodePath with invalid node types
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix xmlGetNodePath with invalid node types
- Date: Sat, 13 Mar 2021 17:56:44 +0000 (UTC)
commit e20c9c148c725e2933efa143ee6a543a5cae4204
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Sat Mar 13 18:41:47 2021 +0100
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
tree.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/tree.c b/tree.c
index dbc87aa7..c707f598 100644
--- a/tree.c
+++ b/tree.c
@@ -4893,7 +4893,9 @@ xmlGetNodePath(const xmlNode *node)
}
next = ((xmlAttrPtr) cur)->parent;
} else {
- next = cur->parent;
+ xmlFree(buf);
+ xmlFree(buffer);
+ return (NULL);
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]