From 587cfcd69f60510fe381766c27f0ef21d0766477 Mon Sep 17 00:00:00 2001 From: mbuhl Date: Wed, 23 Nov 2022 09:54:04 +0000 Subject: [PATCH] xpathns.py contained a use after free. It runs during make test and is shipped in share/examples. ok aja --- textproc/libxml/Makefile | 2 +- .../patches/patch-python_tests_xpathns_py | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 textproc/libxml/patches/patch-python_tests_xpathns_py diff --git a/textproc/libxml/Makefile b/textproc/libxml/Makefile index 0f27510432d..7e06b1d271b 100644 --- a/textproc/libxml/Makefile +++ b/textproc/libxml/Makefile @@ -8,7 +8,7 @@ PKGNAME-main= libxml-${VERSION} PKGNAME-python= py3-libxml-${VERSION} REVISION-main= 1 -REVISION-python= 2 +REVISION-python= 3 SHARED_LIBS += xml2 18.0 # 12.3 diff --git a/textproc/libxml/patches/patch-python_tests_xpathns_py b/textproc/libxml/patches/patch-python_tests_xpathns_py new file mode 100644 index 00000000000..b7674d5ca63 --- /dev/null +++ b/textproc/libxml/patches/patch-python_tests_xpathns_py @@ -0,0 +1,20 @@ +https://gitlab.gnome.org/GNOME/libxml2/-/commit/97c0a9cff728f5091771509567185c26a26669b4 +Index: python/tests/xpathns.py +--- python/tests/xpathns.py.orig ++++ python/tests/xpathns.py +@@ -11,6 +11,7 @@ d = libxml2.parseDoc("") + res="" + for n in d.xpathEval("//namespace::*"): + res = res + n.serialize() ++del n + d.freeDoc() + + if res != expect: +@@ -18,7 +19,6 @@ if res != expect: + print(res) + del res + del d +-del n + # Memory debug specific + libxml2.cleanupParser() +