From 31b7c1f66f6905e26af2dfbea5fe9ad5f261bfa4 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Tue, 27 Jul 2021 12:57:50 +0200 Subject: [PATCH 1/2] libxml2: update to 2.9.12. --- srcpkgs/libxml2/patches/CVE-2019-20388.patch | 32 -------------------- srcpkgs/libxml2/template | 6 ++-- 2 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 srcpkgs/libxml2/patches/CVE-2019-20388.patch diff --git a/srcpkgs/libxml2/patches/CVE-2019-20388.patch b/srcpkgs/libxml2/patches/CVE-2019-20388.patch deleted file mode 100644 index b0fee2ef010e..000000000000 --- a/srcpkgs/libxml2/patches/CVE-2019-20388.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 6088a74bcf7d0c42e24cff4594d804e1d3c9fbca Mon Sep 17 00:00:00 2001 -From: Zhipeng Xie -Date: Tue, 20 Aug 2019 16:33:06 +0800 -Subject: [PATCH] Fix memory leak in xmlSchemaValidateStream - -When ctxt->schema is NULL, xmlSchemaSAXPlug->xmlSchemaPreRun -alloc a new schema for ctxt->schema and set vctxt->xsiAssemble -to 1. Then xmlSchemaVStart->xmlSchemaPreRun initialize -vctxt->xsiAssemble to 0 again which cause the alloced schema -can not be freed anymore. - -Found with libFuzzer. - -Signed-off-by: Zhipeng Xie ---- - xmlschemas.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/xmlschemas.c b/xmlschemas.c -index 301c8449..39d92182 100644 ---- a/xmlschemas.c -+++ b/xmlschemas.c -@@ -28090,7 +28090,6 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { - vctxt->nberrors = 0; - vctxt->depth = -1; - vctxt->skipDepth = -1; -- vctxt->xsiAssemble = 0; - vctxt->hasKeyrefs = 0; - #ifdef ENABLE_IDC_NODE_TABLES_TEST - vctxt->createIDCNodeTables = 1; --- -2.24.1 diff --git a/srcpkgs/libxml2/template b/srcpkgs/libxml2/template index c334f505ed0c..a5998d76c6a1 100644 --- a/srcpkgs/libxml2/template +++ b/srcpkgs/libxml2/template @@ -3,8 +3,8 @@ # Please keep this in sync with "srcpkgs/libxml2-python" # pkgname=libxml2 -version=2.9.10 -revision=4 +version=2.9.12 +revision=1 build_style=gnu-configure configure_args="--with-threads --with-history --with-icu --without-python" hostmakedepends="automake libtool gettext-devel pkg-config" @@ -14,7 +14,7 @@ maintainer="Enno Boland " license="MIT" homepage="http://www.xmlsoft.org/" distfiles="http://xmlsoft.org/sources/${pkgname}-${version}.tar.gz" -checksum=aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f +checksum=c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92 pre_configure() { autoreconf -fi From 40bd1380a2e7f5b204a6b26eb77d32c84530e775 Mon Sep 17 00:00:00 2001 From: Michal Vasilek Date: Tue, 27 Jul 2021 12:57:54 +0200 Subject: [PATCH 2/2] libxml2-python: update to 2.9.12. --- .../libxml2-python/patches/py39compat.patch | 68 ------------------- srcpkgs/libxml2-python/template | 9 +-- srcpkgs/libxml2-python/update | 1 + 3 files changed, 6 insertions(+), 72 deletions(-) delete mode 100644 srcpkgs/libxml2-python/patches/py39compat.patch create mode 100644 srcpkgs/libxml2-python/update diff --git a/srcpkgs/libxml2-python/patches/py39compat.patch b/srcpkgs/libxml2-python/patches/py39compat.patch deleted file mode 100644 index 56130471793e..000000000000 --- a/srcpkgs/libxml2-python/patches/py39compat.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- a/python/libxml.c 2020-10-07 14:41:45.226029584 -0400 -+++ b/python/libxml.c 2020-10-07 14:42:58.965113111 -0400 -@@ -294,7 +294,7 @@ - lenread = PyBytes_Size(ret); - data = PyBytes_AsString(ret); - #ifdef PyUnicode_Check -- } else if PyUnicode_Check (ret) { -+ } else if (PyUnicode_Check (ret)) { - #if PY_VERSION_HEX >= 0x03030000 - Py_ssize_t size; - const char *tmp; -@@ -359,7 +359,7 @@ - lenread = PyBytes_Size(ret); - data = PyBytes_AsString(ret); - #ifdef PyUnicode_Check -- } else if PyUnicode_Check (ret) { -+ } else if (PyUnicode_Check (ret)) { - #if PY_VERSION_HEX >= 0x03030000 - Py_ssize_t size; - const char *tmp; ---- a/python/types.c 2020-10-07 14:41:49.393034304 -0400 -+++ b/python/types.c 2020-10-07 14:42:23.496072934 -0400 -@@ -602,16 +602,16 @@ - if (obj == NULL) { - return (NULL); - } -- if PyFloat_Check (obj) { -+ if (PyFloat_Check (obj)) { - ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj)); -- } else if PyLong_Check(obj) { -+ } else if (PyLong_Check(obj)) { - #ifdef PyLong_AS_LONG - ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj)); - #else - ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj)); - #endif - #ifdef PyBool_Check -- } else if PyBool_Check (obj) { -+ } else if (PyBool_Check (obj)) { - - if (obj == Py_True) { - ret = xmlXPathNewBoolean(1); -@@ -620,14 +620,14 @@ - ret = xmlXPathNewBoolean(0); - } - #endif -- } else if PyBytes_Check (obj) { -+ } else if (PyBytes_Check (obj)) { - xmlChar *str; - - str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj), - PyBytes_GET_SIZE(obj)); - ret = xmlXPathWrapString(str); - #ifdef PyUnicode_Check -- } else if PyUnicode_Check (obj) { -+ } else if (PyUnicode_Check (obj)) { - #if PY_VERSION_HEX >= 0x03030000 - xmlChar *str; - const char *tmp; -@@ -650,7 +650,7 @@ - ret = xmlXPathWrapString(str); - #endif - #endif -- } else if PyList_Check (obj) { -+ } else if (PyList_Check (obj)) { - int i; - PyObject *node; - xmlNodePtr cur; diff --git a/srcpkgs/libxml2-python/template b/srcpkgs/libxml2-python/template index 4208519dac3e..bff8f3da31cd 100644 --- a/srcpkgs/libxml2-python/template +++ b/srcpkgs/libxml2-python/template @@ -1,19 +1,19 @@ # Template file for 'libxml2-python' pkgname=libxml2-python -version=2.9.10 -revision=3 +version=2.9.12 +revision=1 wrksrc="${pkgname%-python}-${version}" build_wrksrc=python build_style=python-module hostmakedepends="python-devel python3-devel" makedepends="libxml2-devel python-devel python3-devel" -depends="python python3" +depends="python" short_desc="Library providing XML and HTML support - Python2 bindings" maintainer="Enno Boland " license="MIT" homepage="http://www.xmlsoft.org/" distfiles="http://xmlsoft.org/sources/libxml2-${version}.tar.gz" -checksum=aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f +checksum=c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92 post_patch() { if [ "${CROSS_BUILD}" ]; then @@ -27,6 +27,7 @@ post_install() { libxml2-python3_package() { short_desc="${short_desc/Python2/Python3}" + depends="python3" pkg_install() { vmove "usr/lib/python3*" vlicense ../COPYING diff --git a/srcpkgs/libxml2-python/update b/srcpkgs/libxml2-python/update new file mode 100644 index 000000000000..ae82ead5e6d7 --- /dev/null +++ b/srcpkgs/libxml2-python/update @@ -0,0 +1 @@ +pkgname=libxml2