[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2023-05-10 Thread Sam James
commit: 97f1778b35848eed1adca03fa45dcf5c337e01c1
Author: Sam James  gentoo  org>
AuthorDate: Wed May 10 22:00:25 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Wed May 10 22:00:25 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97f1778b

dev-libs/libxml2: backport various patches to 2.11.2 from 2.11.x branch

2.11.3 should be coming soon hopefully.

Signed-off-by: Sam James  gentoo.org>

 .../libxml2/files/libxml2-2.11.2-0001-iconv.patch  |  63 ++
 .../libxml2-2.11.2-0002-crash-old-libxslt.patch|  27 +++
 .../files/libxml2-2.11.2-0003-no-xpath.patch   | 245 +
 .../files/libxml2-2.11.2-0004-huge-push.patch  |  27 +++
 .../files/libxml2-2.11.2-0005-icu-detection.patch  |  21 ++
 dev-libs/libxml2/libxml2-2.11.2-r1.ebuild  | 206 +
 6 files changed, 589 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.11.2-0001-iconv.patch 
b/dev-libs/libxml2/files/libxml2-2.11.2-0001-iconv.patch
new file mode 100644
index ..615f413c4419
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.11.2-0001-iconv.patch
@@ -0,0 +1,63 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/commit/9c1f5fe7fbad2b57149c628802c4ded3e4f3d284
+
+From 9c1f5fe7fbad2b57149c628802c4ded3e4f3d284 Mon Sep 17 00:00:00 2001
+From: Mike Dalessio 
+Date: Fri, 5 May 2023 17:34:57 -0400
+Subject: [PATCH] autoconf: fix iconv library paths
+
+and pass cflags when building executables
+
+See 0f77167f for prior related work
+--- a/Makefile.am
 b/Makefile.am
+@@ -145,11 +145,12 @@ runsuite_DEPENDENCIES = $(DEPS)
+ runsuite_LDADD= $(LDADDS)
+ 
+ xmllint_SOURCES=xmllint.c
+-xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS)
++xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
+ xmllint_DEPENDENCIES = $(DEPS)
+ xmllint_LDADD=  $(RDL_LIBS) $(LDADDS)
+ 
+ xmlcatalog_SOURCES=xmlcatalog.c
++xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
+ xmlcatalog_DEPENDENCIES = $(DEPS)
+ xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
+ 
+--- a/configure.ac
 b/configure.ac
+@@ -1036,7 +1036,7 @@ else
+ if test "$with_iconv" != "yes" && test "$with_iconv" != "" ; then
+   ICONV_DIR=$with_iconv
+   CPPFLAGS="$CPPFLAGS -I$ICONV_DIR/include"
+-LIBS="$LIBS -L$ICONV_DIR/libs"
++  LIBS="$LIBS -L$ICONV_DIR/lib"
+   # Export this since our headers include iconv.h
+   XML_INCLUDEDIR="$XML_INCLUDEDIR -I$ICONV_DIR/include"
+ fi
+@@ -1052,12 +1052,13 @@ else
+ ICONV_LIBS="-liconv"])])])
+ if test "$WITH_ICONV" = "1" && test "$ICONV_DIR" != ""; then
+ ICONV_CFLAGS="-I$ICONV_DIR/include"
+-ICONV_LIBS="-L$ICONV_DIR/libs $ICONV_LIBS"
++ICONV_LIBS="-L$ICONV_DIR/lib $ICONV_LIBS"
+ fi
+ CPPFLAGS=$_cppflags
+ LIBS=$_libs
+ fi
+ AC_SUBST(WITH_ICONV)
++AC_SUBST(ICONV_CFLAGS)
+ 
+ dnl
+ dnl Checks for ICU library.
+@@ -1100,7 +1101,7 @@ else
+ ICU_LIBS=-licucore
+ if test "$ICU_DIR" != ""; then
+ ICU_CFLAGS="-I$ICU_DIR/include"
+-ICU_LIBS="-L$ICU_DIR/libs $ICU_LIBS"
++ICU_LIBS="-L$ICU_DIR/lib $ICU_LIBS"
+ fi])])
+ CPPFLAGS=$_cppflags
+ LIBS=$_libs
+-- 
+GitLab

diff --git a/dev-libs/libxml2/files/libxml2-2.11.2-0002-crash-old-libxslt.patch 
b/dev-libs/libxml2/files/libxml2-2.11.2-0002-crash-old-libxslt.patch
new file mode 100644
index ..2253ea6211d1
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.11.2-0002-crash-old-libxslt.patch
@@ -0,0 +1,27 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/commit/e6a9cc8d66778c20435a46e50d4e5866deace5f6
+
+From e6a9cc8d66778c20435a46e50d4e5866deace5f6 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer 
+Date: Sat, 6 May 2023 15:28:13 +0200
+Subject: [PATCH] hash: Fix possible startup crash with old libxslt versions
+
+Call xmlInitParser in xmlHashCreate to make it work if the library
+wasn't initialized yet.
+
+Otherwise, exsltRegisterAll from libxslt 1.1.24 or older might cause
+a crash.
+
+See #534.
+--- a/hash.c
 b/hash.c
+@@ -180,6 +180,8 @@ xmlHashTablePtr
+ xmlHashCreate(int size) {
+ xmlHashTablePtr table;
+ 
++xmlInitParser();
++
+ if (size <= 0)
+ size = 256;
+ 
+-- 
+GitLab

diff --git a/dev-libs/libxml2/files/libxml2-2.11.2-0003-no-xpath.patch 
b/dev-libs/libxml2/files/libxml2-2.11.2-0003-no-xpath.patch
new file mode 100644
index ..f036c5814f26
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.11.2-0003-no-xpath.patch
@@ -0,0 +1,245 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/commit/41e78f8f8656b8e2206c06995da6bd8dcc82823d
+
+From 41e78f8f8656b8e2206c06995da6bd8dcc82823d Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer 
+Date: Mon, 8 May 2023 23:12:33 +0200
+Subject: [PATCH] xpath: Fix build without LIBXML_XPATH_ENABLED
+
+Move static function declaration into XPATH block. Also move comparison
+functions.
+
+Fixes #537.
+--- a/xpa

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2022-11-29 Thread David Seifert
commit: bee4fbd32b0225d09bf7fca8d38b83a9ac368bfd
Author: David Seifert  gentoo  org>
AuthorDate: Tue Nov 29 19:58:44 2022 +
Commit: David Seifert  gentoo  org>
CommitDate: Tue Nov 29 19:58:44 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bee4fbd3

dev-libs/libxml2: add workaround patch for itstool breakage

Bug: https://bugs.gentoo.org/745162
Signed-off-by: David Seifert  gentoo.org>

 .../libxml2-2.10.3-python3-unicode-errors.patch| 35 ++
 ...xml2-2.10.3.ebuild => libxml2-2.10.3-r1.ebuild} |  2 ++
 2 files changed, 37 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.10.3-python3-unicode-errors.patch 
b/dev-libs/libxml2/files/libxml2-2.10.3-python3-unicode-errors.patch
new file mode 100644
index ..525e1fe36c0b
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.10.3-python3-unicode-errors.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/745162
+https://gitlab.gnome.org/GNOME/libxml2/-/issues/64
+
+--- a/python/libxml.c
 b/python/libxml.c
+@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+ PyObject *message;
+ PyObject *result;
+ char str[1000];
++unsigned char *ptr = (unsigned char *)str;
+ 
+ #ifdef DEBUG_ERROR
+ printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
+@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+   str[999] = 0;
+ va_end(ap);
+ 
++#if PY_MAJOR_VERSION >= 3
++/* Ensure the error string doesn't start at UTF8 continuation. */
++while (*ptr && (*ptr & 0xc0) == 0x80)
++ptr++;
++#endif
++
+ list = PyTuple_New(2);
+ PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
+ Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
+-message = libxml_charPtrConstWrap(str);
++message = libxml_charPtrConstWrap(ptr);
+ PyTuple_SetItem(list, 1, message);
+ result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
++/* Forget any errors caused in the error handler. */
++PyErr_Clear();
+ Py_XDECREF(list);
+ Py_XDECREF(result);
+ }

diff --git a/dev-libs/libxml2/libxml2-2.10.3.ebuild 
b/dev-libs/libxml2/libxml2-2.10.3-r1.ebuild
similarity index 98%
rename from dev-libs/libxml2/libxml2-2.10.3.ebuild
rename to dev-libs/libxml2/libxml2-2.10.3-r1.ebuild
index 7b940b3948b0..bc2c968b0da6 100644
--- a/dev-libs/libxml2/libxml2-2.10.3.ebuild
+++ b/dev-libs/libxml2/libxml2-2.10.3-r1.ebuild
@@ -56,6 +56,8 @@ MULTILIB_CHOST_TOOLS=(
/usr/bin/xml2-config
 )
 
+PATCHES=( "${FILESDIR}"/${PN}-2.10.3-python3-unicode-errors.patch )
+
 DOCS=( NEWS README.md TODO TODO_SCHEMAS python/TODO )
 
 src_unpack() {



[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2021-10-29 Thread David Seifert
commit: 1f361d68bae474c55c7d08826107f9b2ef73ae81
Author: David Seifert  gentoo  org>
AuthorDate: Fri Oct 29 13:46:13 2021 +
Commit: David Seifert  gentoo  org>
CommitDate: Fri Oct 29 13:46:13 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f361d68

dev-libs/libxml2: drop 2.9.10-r5, 2.9.12, 2.9.12-r2, 2.9.12-r3

Signed-off-by: David Seifert  gentoo.org>

 dev-libs/libxml2/Manifest  |   5 -
 .../libxml2/files/libxml2-2.7.1-catalog_path.patch |  66 --
 .../libxml2/files/libxml2-2.9.10-remove-TRUE.patch |  24 --
 .../files/libxml2-2.9.10-xmllint-utf8.patch|  30 ---
 .../files/libxml2-2.9.11-disable-fuzz-tests.patch  |  33 ---
 .../files/libxml2-2.9.2-python-ABIFLAG.patch   |  11 -
 .../files/libxml2-2.9.8-out-of-tree-test.patch |  32 ---
 .../libxml2-2.9.8-python3-unicode-errors.patch |  33 ---
 dev-libs/libxml2/libxml2-2.9.10-r5.ebuild  | 240 
 dev-libs/libxml2/libxml2-2.9.12-r2.ebuild  | 249 
 dev-libs/libxml2/libxml2-2.9.12-r3.ebuild  | 251 -
 dev-libs/libxml2/libxml2-2.9.12.ebuild | 240 
 12 files changed, 1214 deletions(-)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index a3ddfee2530..f529aea0838 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,11 +1,6 @@
-DIST libxml2-2.9.10-r1-patchset.tar.xz 72088 BLAKE2B 
4d5f8aed35d6c0232089e09f22a77cbd25cbd2007c1330538e1c7acc4398ec3ef9023289129677cf5499dbacde4c2f28850ae81acab351d02625d3452aedaede
 SHA512 
a63032d1e85128f637c2b54356aab06a17e31eb1f5facd8fdf88463eb21df6a1d9fd8cc751fa94b8d322fa4f796be4e1d9aa071cbd0826ab31fae46525fde952
-DIST libxml2-2.9.10.tar.gz 5624761 BLAKE2B 
a9958bd7db17fbfb8259b64d66548eb19d28f1aecf40cf66752fcec5720855d31cea9941d52963badd8c18ea1770485f1c11da6213149458336ce0273418f421
 SHA512 
0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed
-DIST libxml2-2.9.12-r2-patchset.tar.bz2 5939 BLAKE2B 
e518a174385a121ca5545d0a51c2a2b4ddd21b1e7996e2806f368588b27d60e8318ab50ebfb90c3ee57ccece4f1c37e05c1daeed4203a4e9cb5a056ba530ad2b
 SHA512 
06b96ab8426cd560c1147998965b5e718bee08536549a278269f6535ff1460ed97d83067ed0e8a4d834145a5e5a6caa912cf8aa5a33a360e4b1bc9d9135bfb04
-DIST libxml2-2.9.12-r3-patchset.tar.bz2 6281 BLAKE2B 
b7038f85009afdacc2fcf0b9cf30f915f20a2c8dfbe3749c6e74c637191f97169ee46b26deac5e347230d956f2d5aded218d09f0232f23b39ef4ad5e2fd09f61
 SHA512 
8170462eb3ecd2f834650309498a4e586fb3edb3114f42b3c95e96dc2ca81181e70ccd1790c440bd7ef4f489a2311b99765dcd12d9fb52207a11fb4394409ae8
 DIST libxml2-2.9.12-r5-patchset.tar.bz2 7231 BLAKE2B 
d9d0d56ebccbfe234a8af04cc5343c1a02d84fbd998c2373fd48be59cf92807a9417db650a6bb6ba309e101994c4ae2b28edda7bf635c7728eb8b8047d0d3391
 SHA512 
b2db0fe4595c1559d9f8dc836ee6eee469191f6c490fc95d25d9fa99a544e80858894cc35b6e4a6624a38d0309800540badc929e86ef29950c1107caa4656a14
 DIST libxml2-2.9.12.tar.gz 5681632 BLAKE2B 
ab93633140e9fd119d3a48ed829a91213c3d7956a00d181203f5188fb0ed0d3a7150d3128fe986b13efadf6fe484393262a3de575527f38f74aa6c0067a6d934
 SHA512 
df1c6486e80f0fcf3c506f3599bcfb94b620c00d0b5d26831bc983daa78d58ec58b5057b1ec7c1a26c694f40199c6234ee2a6dcabf65abfa10c447cb5705abbd
 DIST libxml2-2.9.12.tar.gz.asc 488 BLAKE2B 
48ec86ec373d94de73bdb52141fc77fccd0ca296a35ed97aa3479ecdcf82b15422dd7d751359b5b1ca477e24b8eee9226784cfbfd861236e10eed2519e7959bf
 SHA512 
69ca6ab7170cad467724e19eff99a3544966a26069e78a7b7cc27ae93a9077b11cc8dad2536bd0b27c3b45f4ea7520c813fe5a018cd65f103059f7f75147a656
-DIST xmlts20080827.tar.gz 638940 BLAKE2B 
c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7
 SHA512 
7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d
 DIST xmlts20130923.tar.gz 641522 BLAKE2B 
63a47bc69278ef510cd0b3779aed729e1b309e30efa0015d28ed051cc03f9dfddb447ab57b07b3393e8f47393d15473b0e199c34cb1f5f746b15ddfaa55670be
 SHA512 
d5c4d26b324ed21f4e0641cd7f8b76dbf9de80df8b519982e44d41c960df29fd03618e02e9693b2d11ad06d19c4a965274c95a048ec3b9653eacb919a7f8b733
 DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 
1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25
 SHA512 
43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288
 DIST xsts-2004-01-14.tar.gz 2761085 BLAKE2B 
41545995fb3a65d053257c376c07d45ffd1041a433bfbdb46d4dd87a5afb60c18c8629a3d988323f9e7a1d709775b5a7e5930276a7121c0725a22705c0976e36
 SHA512 
32854388d7e720ad67156baf50bf2bae7bd878ca3e35fd7e44e57cad3f434f69d56bbbedd61509f8a1faf01c9eae74a078df8fe130780b182c05c05cb1c39ebe

diff --git a/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch 
b/dev-libs/libxml2/fil

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2021-05-19 Thread Sam James
commit: 6d220e09b25048d28d6598f8a6ffb62f0fbe92b4
Author: Sam James  gentoo  org>
AuthorDate: Thu May 20 01:33:39 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu May 20 01:46:11 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d220e09

dev-libs/libxml2: include lxml compatibility patch

Bug: https://bugs.gentoo.org/790737
Signed-off-by: Sam James  gentoo.org>

 .../libxml2-2.9.12-fix-lxml-compatibility.patch| 214 ++
 dev-libs/libxml2/libxml2-2.9.12-r1.ebuild  | 245 +
 2 files changed, 459 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.12-fix-lxml-compatibility.patch 
b/dev-libs/libxml2/files/libxml2-2.9.12-fix-lxml-compatibility.patch
new file mode 100644
index 000..844266038d3
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.12-fix-lxml-compatibility.patch
@@ -0,0 +1,214 @@
+https://gitlab.gnome.org/nwellnhof/libxml2/-/commit/7955b0d6fbbe49392ccc2e511edd00fbbfcb5a10.patch
+https://gitlab.gnome.org/GNOME/libxml2/-/issues/255
+https://bugs.gentoo.org/790737
+
+From 7955b0d6fbbe49392ccc2e511edd00fbbfcb5a10 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer 
+Date: Tue, 18 May 2021 20:08:28 +0200
+Subject: [PATCH] Work around lxml API abuse
+
+Make xmlNodeDumpOutput and htmlNodeDumpFormatOutput work with corrupted
+parent pointers. This used to work with the old recursive code but the
+non-recursive rewrite required parent pointers to be set correctly.
+
+Unfortunately, lxml relies on the old behavior and passes subtrees with
+a corrupted structure. Fall back to a recursive function call if an
+invalid parent pointer is detected.
+
+Fixes #255.
+---
+ HTMLtree.c | 46 --
+ xmlsave.c  | 31 +--
+ 2 files changed, 49 insertions(+), 28 deletions(-)
+
+diff --git a/HTMLtree.c b/HTMLtree.c
+index 24434d453..bdd639c7f 100644
+--- a/HTMLtree.c
 b/HTMLtree.c
+@@ -744,7 +744,7 @@ void
+ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED,
+  int format) {
+-xmlNodePtr root;
++xmlNodePtr root, parent;
+ xmlAttrPtr attr;
+ const htmlElemDesc * info;
+ 
+@@ -755,6 +755,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr 
doc,
+ }
+ 
+ root = cur;
++parent = cur->parent;
+ while (1) {
+ switch (cur->type) {
+ case XML_HTML_DOCUMENT_NODE:
+@@ -762,13 +763,25 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, 
xmlDocPtr doc,
+ if (((xmlDocPtr) cur)->intSubset != NULL) {
+ htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
+ }
+-if (cur->children != NULL) {
++/* Always validate cur->parent when descending. */
++if ((cur->parent == parent) && (cur->children != NULL)) {
++parent = cur;
+ cur = cur->children;
+ continue;
+ }
+ break;
+ 
+ case XML_ELEMENT_NODE:
++/*
++ * Some users like lxml are known to pass nodes with a corrupted
++ * tree structure. Fall back to a recursive call to handle this
++ * case.
++ */
++if ((cur->parent != parent) && (cur->children != NULL)) {
++htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
++break;
++}
++
+ /*
+  * Get specific HTML info for that node.
+  */
+@@ -817,6 +830,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr 
doc,
+ (cur->name != NULL) &&
+ (cur->name[0] != 'p')) /* p, pre, param */
+ xmlOutputBufferWriteString(buf, "\n");
++parent = cur;
+ cur = cur->children;
+ continue;
+ }
+@@ -825,9 +839,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr 
doc,
+ (info != NULL) && (!info->isinline)) {
+ if ((cur->next->type != HTML_TEXT_NODE) &&
+ (cur->next->type != HTML_ENTITY_REF_NODE) &&
+-(cur->parent != NULL) &&
+-(cur->parent->name != NULL) &&
+-(cur->parent->name[0] != 'p')) /* p, pre, param */
++(parent != NULL) &&
++(parent->name != NULL) &&
++(parent->name[0] != 'p')) /* p, pre, param */
+ xmlOutputBufferWriteString(buf, "\n");
+ }
+ 
+@@ -842,9 +856,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr 
doc,
+ break;
+ if (((cur->name == (const xmlChar *)xmlStringText) ||
+  (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
+-((cur->parent == NULL) ||
+- ((xmlStrcasecmp(cu

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2021-05-13 Thread Sam James
commit: 6aa57ec7fe0a20bf67be358b0badfd149df2c3ec
Author: Sam James  gentoo  org>
AuthorDate: Thu May 13 17:49:51 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Thu May 13 17:50:36 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6aa57ec7

dev-libs/libxml2: add 2.9.11

Without tests for now because:
- fuzz test files aren't included in the distfile (bug is upstream)
- Python tests seem to fail now but rest pass

Bug: https://bugs.gentoo.org/790002
Signed-off-by: Sam James  gentoo.org>

 dev-libs/libxml2/Manifest  |   1 +
 .../files/libxml2-2.9.11-disable-fuzz-tests.patch  |  33 +++
 dev-libs/libxml2/libxml2-2.9.11.ebuild | 234 +
 3 files changed, 268 insertions(+)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index 9ded83cf33f..3bc54c16073 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,5 +1,6 @@
 DIST libxml2-2.9.10-r1-patchset.tar.xz 72088 BLAKE2B 
4d5f8aed35d6c0232089e09f22a77cbd25cbd2007c1330538e1c7acc4398ec3ef9023289129677cf5499dbacde4c2f28850ae81acab351d02625d3452aedaede
 SHA512 
a63032d1e85128f637c2b54356aab06a17e31eb1f5facd8fdf88463eb21df6a1d9fd8cc751fa94b8d322fa4f796be4e1d9aa071cbd0826ab31fae46525fde952
 DIST libxml2-2.9.10.tar.gz 5624761 BLAKE2B 
a9958bd7db17fbfb8259b64d66548eb19d28f1aecf40cf66752fcec5720855d31cea9941d52963badd8c18ea1770485f1c11da6213149458336ce0273418f421
 SHA512 
0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed
+DIST libxml2-2.9.11.tar.gz 5676226 BLAKE2B 
16420e593e075d23a4cd363f9adb3505a6779b1500c35fbbafa19b64a2b72f1d43b186579e02a3bcfaab52e5b69df223ded00d76bb25eb09d07d57fe423b94b1
 SHA512 
d9c71d75d1cd0708f56fef47802ce53d6c64c4580469458edb2fc12b699319235bcff62bc1be1f0a01f4077726e37ad2cf5e4dee4bca36a9d5d3b21d12253ba5
 DIST xmlts20080827.tar.gz 638940 BLAKE2B 
c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7
 SHA512 
7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d
 DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 
1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25
 SHA512 
43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288
 DIST xsts-2004-01-14.tar.gz 2761085 BLAKE2B 
41545995fb3a65d053257c376c07d45ffd1041a433bfbdb46d4dd87a5afb60c18c8629a3d988323f9e7a1d709775b5a7e5930276a7121c0725a22705c0976e36
 SHA512 
32854388d7e720ad67156baf50bf2bae7bd878ca3e35fd7e44e57cad3f434f69d56bbbedd61509f8a1faf01c9eae74a078df8fe130780b182c05c05cb1c39ebe

diff --git a/dev-libs/libxml2/files/libxml2-2.9.11-disable-fuzz-tests.patch 
b/dev-libs/libxml2/files/libxml2-2.9.11-disable-fuzz-tests.patch
new file mode 100644
index 000..7f6fd4ae826
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.11-disable-fuzz-tests.patch
@@ -0,0 +1,33 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/issues/252
+
+From 5d6403682a3463f29a1f7c27aa54ecb5e3971547 Mon Sep 17 00:00:00 2001
+From: Sam James 
+Date: Thu, 13 May 2021 17:40:22 +
+Subject: [PATCH] Disable fuzz tests
+
+Not all of the fuzz files are included with the dist tarball,
+so disabling them for now to get the release in with most tests
+given the security bug.
+--- a/Makefile.am
 b/Makefile.am
+@@ -2,9 +2,9 @@
+ 
+ ACLOCAL_AMFLAGS = -I m4
+ 
+-SUBDIRS = include . doc example fuzz xstc $(PYTHON_SUBDIR)
++SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
+ 
+-DIST_SUBDIRS = include . doc example fuzz python xstc
++DIST_SUBDIRS = include . doc example python xstc
+ 
+ AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
+ 
+@@ -210,7 +210,6 @@ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) 
testapi$(EXEEXT) \
+   $(CHECKER) ./runxmlconf$(EXEEXT)
+   @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
+   $(MAKE) tests ; fi)
+-  @cd fuzz; $(MAKE) tests
+ 
+ check: all runtests
+ 
+-- 

diff --git a/dev-libs/libxml2/libxml2-2.9.11.ebuild 
b/dev-libs/libxml2/libxml2-2.9.11.ebuild
new file mode 100644
index 000..33bd19bfcd6
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.9.11.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_REQ_USE="xml"
+
+inherit autotools flag-o-matic prefix python-r1 multilib-minimal
+
+# Note: Please bump in sync with dev-libs/libxslt
+XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite";
+XSTS_NAME_1="xmlschema2002-01-16"
+XSTS_NAME_2="xmlschema2004-01-14"
+XSTS_TARBALL_1="xsts-2002-01-16.tar.gz"
+XSTS_TARBALL_2="xsts-2004-01-14.tar.gz"
+XMLCONF_TARBALL="xmlts20080827.tar.gz"
+DESCRIPTION="XML C parser and too

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2020-12-02 Thread Sam James
commit: da4038c33b2c7684f5766d6e8f1d1089e863e87c
Author: Sam James  gentoo  org>
AuthorDate: Thu Dec  3 00:13:24 2020 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Dec  3 00:14:49 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da4038c3

dev-libs/libxml2: restore itstool-segfault patch

We stopped applying this patch during a roll
of a new patchset (my fault), but it seems to still
be needed. Noticed when building some of MATE.

Bug: https://bugs.gentoo.org/745162
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Sam James  gentoo.org>

 .../libxml2-2.9.8-python3-unicode-errors.patch | 34 ++
 ...2-2.9.10-r3.ebuild => libxml2-2.9.10-r4.ebuild} |  3 ++
 2 files changed, 37 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch 
b/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch
new file mode 100644
index 000..e87dcdedf88
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch
@@ -0,0 +1,34 @@
+Index: libxml2-2.9.5/python/libxml.c
+===
+--- libxml2-2.9.5.orig/python/libxml.c
 libxml2-2.9.5/python/libxml.c
+@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+ PyObject *message;
+ PyObject *result;
+ char str[1000];
++unsigned char *ptr = (unsigned char *)str;
+ 
+ #ifdef DEBUG_ERROR
+ printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
+@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+   str[999] = 0;
+ va_end(ap);
+ 
++#if PY_MAJOR_VERSION >= 3
++/* Ensure the error string doesn't start at UTF8 continuation. */
++while (*ptr && (*ptr & 0xc0) == 0x80)
++ptr++;
++#endif
++
+ list = PyTuple_New(2);
+ PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
+ Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
+-message = libxml_charPtrConstWrap(str);
++message = libxml_charPtrConstWrap(ptr);
+ PyTuple_SetItem(list, 1, message);
+ result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
++/* Forget any errors caused in the error handler. */
++PyErr_Clear();
+ Py_XDECREF(list);
+ Py_XDECREF(result);
+ }

diff --git a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild 
b/dev-libs/libxml2/libxml2-2.9.10-r4.ebuild
similarity index 98%
rename from dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
rename to dev-libs/libxml2/libxml2-2.9.10-r4.ebuild
index 916abdd469c..a6678320ffe 100644
--- a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.10-r4.ebuild
@@ -93,6 +93,9 @@ src_prepare() {
# Fix python tests when building out of tree #565576
eapply "${FILESDIR}"/${PN}-2.9.8-out-of-tree-test.patch
 
+   # bug #745162
+   eapply "${FILESDIR}"/${PN}-2.9.8-python3-unicode-errors.patch
+
if [[ ${CHOST} == *-darwin* ]] ; then
# Avoid final linking arguments for python modules
sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' configure.ac || die



[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2020-10-30 Thread Matt Turner
commit: f016ee441ef5590db02e09198fcbf6b12a463c50
Author: Matt Turner  gentoo  org>
AuthorDate: Fri Oct 30 22:37:29 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Oct 30 22:38:56 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f016ee44

dev-libs/libxml2: Drop old versions

Signed-off-by: Matt Turner  gentoo.org>

 dev-libs/libxml2/Manifest  |   3 -
 .../files/2.9.9-python3-unicode-errors.patch   |  34 ---
 dev-libs/libxml2/libxml2-2.9.10-r2.ebuild  | 224 
 dev-libs/libxml2/libxml2-2.9.9-r4.ebuild   | 227 -
 4 files changed, 488 deletions(-)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index ee77f61e855..9ded83cf33f 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,8 +1,5 @@
-DIST libxml2-2.9.10-patchset.tar.xz 71584 BLAKE2B 
4925a28570ed4f84da0407c3ce5b257d0959661855792160e4c534125fe0bbfa3749e7fc43b6c91a17206ac08a85922f4158bf40164c8a17ec940bf12b7dde1c
 SHA512 
cd5a6aa86b6cf9ff852922ecfa23f34edeecab10a0e6d1bcd4dca56a6e17713b10af9387c7a6276bfec612f1d44fc06c16a7bdcab01ef9080f4dd10fab253b93
 DIST libxml2-2.9.10-r1-patchset.tar.xz 72088 BLAKE2B 
4d5f8aed35d6c0232089e09f22a77cbd25cbd2007c1330538e1c7acc4398ec3ef9023289129677cf5499dbacde4c2f28850ae81acab351d02625d3452aedaede
 SHA512 
a63032d1e85128f637c2b54356aab06a17e31eb1f5facd8fdf88463eb21df6a1d9fd8cc751fa94b8d322fa4f796be4e1d9aa071cbd0826ab31fae46525fde952
 DIST libxml2-2.9.10.tar.gz 5624761 BLAKE2B 
a9958bd7db17fbfb8259b64d66548eb19d28f1aecf40cf66752fcec5720855d31cea9941d52963badd8c18ea1770485f1c11da6213149458336ce0273418f421
 SHA512 
0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed
-DIST libxml2-2.9.9-patchset.tar.xz 16792 BLAKE2B 
f761b5cda41d57543dadf2cdd8915b69727a818f31badc1092903a9e4341b807852fed0887e9ec7a06a0c19c4a49f9afc2f3c048947f21a09006bb51ef8399ef
 SHA512 
c8c0ee6d0a2833e5664aa754f8ba63b9f0bbfda46510507d3a958c33ef55daba8cfb1ca73ebffeb44d411b5f4259fe6e11ef0204ad2deebd1708ebfb
-DIST libxml2-2.9.9.tar.gz 5476717 BLAKE2B 
00a67c38084f2effd5d68d7d3e68f0c96cf4f52eab6d8d9b96dc91f03a84baa132abeaf303a836ff9bbf04f832432a036077316c464398e433c9779d8519074b
 SHA512 
cb7784ba4e72e942614e12e4f83f4ceb275f3d738b30e3b5c1f25edf8e9fa6789e854685974eed95b362049dbf6c8e7357e0327d64c681ed390534ac154e6810
 DIST xmlts20080827.tar.gz 638940 BLAKE2B 
c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7
 SHA512 
7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d
 DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 
1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25
 SHA512 
43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288
 DIST xsts-2004-01-14.tar.gz 2761085 BLAKE2B 
41545995fb3a65d053257c376c07d45ffd1041a433bfbdb46d4dd87a5afb60c18c8629a3d988323f9e7a1d709775b5a7e5930276a7121c0725a22705c0976e36
 SHA512 
32854388d7e720ad67156baf50bf2bae7bd878ca3e35fd7e44e57cad3f434f69d56bbbedd61509f8a1faf01c9eae74a078df8fe130780b182c05c05cb1c39ebe

diff --git a/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch 
b/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch
deleted file mode 100644
index e87dcdedf88..000
--- a/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Index: libxml2-2.9.5/python/libxml.c
-===
 libxml2-2.9.5.orig/python/libxml.c
-+++ libxml2-2.9.5/python/libxml.c
-@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
- PyObject *message;
- PyObject *result;
- char str[1000];
-+unsigned char *ptr = (unsigned char *)str;
- 
- #ifdef DEBUG_ERROR
- printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
-@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
-   str[999] = 0;
- va_end(ap);
- 
-+#if PY_MAJOR_VERSION >= 3
-+/* Ensure the error string doesn't start at UTF8 continuation. */
-+while (*ptr && (*ptr & 0xc0) == 0x80)
-+ptr++;
-+#endif
-+
- list = PyTuple_New(2);
- PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
- Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
--message = libxml_charPtrConstWrap(str);
-+message = libxml_charPtrConstWrap(ptr);
- PyTuple_SetItem(list, 1, message);
- result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
-+/* Forget any errors caused in the error handler. */
-+PyErr_Clear();
- Py_XDECREF(list);
- Py_XDECREF(result);
- }

diff --git a/dev-libs/libxml

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2020-10-30 Thread Matt Turner
commit: ffcf01ad268f711faa94fcb5f7d5b3e22ad4a567
Author: Matt Turner  gentoo  org>
AuthorDate: Fri Oct 30 22:27:50 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Oct 30 22:33:53 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffcf01ad

dev-libs/libxml2: Add patch to fix build with icu-68.1

Closes: https://bugs.gentoo.org/751922
Signed-off-by: Matt Turner  gentoo.org>

 .../libxml2/files/libxml2-2.9.10-remove-TRUE.patch | 31 ++
 dev-libs/libxml2/libxml2-2.9.10-r3.ebuild  |  2 ++
 2 files changed, 33 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.10-remove-TRUE.patch 
b/dev-libs/libxml2/files/libxml2-2.9.10-remove-TRUE.patch
new file mode 100644
index 000..e405feb37c3
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.10-remove-TRUE.patch
@@ -0,0 +1,31 @@
+https://bugs.gentoo.org/751922
+https://gitlab.gnome.org/GNOME/libxml2/-/issues/202
+
+From c1bae734f3850f6900cf54d186ca0a9102895d82 Mon Sep 17 00:00:00 2001
+From: Lars Wendler 
+Date: Fri, 30 Oct 2020 10:27:23 +0100
+Subject: [PATCH] Fix build with icu-68.1
+
+icu-68.1 removed macro definitions for TRUE and FALSE
+
+Signed-off-by: Lars Wendler 
+---
+ encoding.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/encoding.c b/encoding.c
+index ad4d8a63..ea1fa99e 100644
+--- a/encoding.c
 b/encoding.c
+@@ -1958,7 +1958,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, 
unsigned char *out,
+ #ifdef LIBXML_ICU_ENABLED
+ else if (handler->uconv_out != NULL) {
+ ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen,
+-  TRUE);
++  1);
+ }
+ #endif /* LIBXML_ICU_ENABLED */
+ else {
+-- 
+2.29.2
+

diff --git a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild 
b/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
index 360bcffb202..916abdd469c 100644
--- a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
@@ -78,6 +78,8 @@ src_prepare() {
# Patches needed for prefix support
eapply "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
 
+   eapply "${FILESDIR}"/${P}-remove-TRUE.patch
+
eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
 
# Fix build for Windows platform



[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2020-01-01 Thread Mart Raudsepp
commit: 3d060cd62d99a7b6f26b30a695701b4ccafcccea
Author: Mart Raudsepp  gentoo  org>
AuthorDate: Wed Jan  1 16:27:19 2020 +
Commit: Mart Raudsepp  gentoo  org>
CommitDate: Wed Jan  1 16:28:19 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d060cd6

dev-libs/libxml2: workaround py3 issues for itstool

Bug: https://bugs.gentoo.org/701020
Package-Manager: Portage-2.3.79, Repoman-2.3.12
Signed-off-by: Mart Raudsepp  gentoo.org>

 .../files/2.9.9-python3-unicode-errors.patch   |  34 +++
 dev-libs/libxml2/libxml2-2.9.9-r3.ebuild   | 227 +
 2 files changed, 261 insertions(+)

diff --git a/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch 
b/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch
new file mode 100644
index 000..e87dcdedf88
--- /dev/null
+++ b/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch
@@ -0,0 +1,34 @@
+Index: libxml2-2.9.5/python/libxml.c
+===
+--- libxml2-2.9.5.orig/python/libxml.c
 libxml2-2.9.5/python/libxml.c
+@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+ PyObject *message;
+ PyObject *result;
+ char str[1000];
++unsigned char *ptr = (unsigned char *)str;
+ 
+ #ifdef DEBUG_ERROR
+ printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
+@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+   str[999] = 0;
+ va_end(ap);
+ 
++#if PY_MAJOR_VERSION >= 3
++/* Ensure the error string doesn't start at UTF8 continuation. */
++while (*ptr && (*ptr & 0xc0) == 0x80)
++ptr++;
++#endif
++
+ list = PyTuple_New(2);
+ PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
+ Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
+-message = libxml_charPtrConstWrap(str);
++message = libxml_charPtrConstWrap(ptr);
+ PyTuple_SetItem(list, 1, message);
+ result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
++/* Forget any errors caused in the error handler. */
++PyErr_Clear();
+ Py_XDECREF(list);
+ Py_XDECREF(result);
+ }

diff --git a/dev-libs/libxml2/libxml2-2.9.9-r3.ebuild 
b/dev-libs/libxml2/libxml2-2.9.9-r3.ebuild
new file mode 100644
index 000..5f7f29a15de
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.9.9-r3.ebuild
@@ -0,0 +1,227 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} )
+PYTHON_REQ_USE="xml"
+
+inherit libtool flag-o-matic python-r1 autotools prefix multilib-minimal
+
+DESCRIPTION="XML C parser and toolkit"
+HOMEPAGE="http://www.xmlsoft.org/";
+
+LICENSE="MIT"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv 
~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos 
~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris 
~x86-solaris"
+IUSE="debug examples icu ipv6 lzma python readline static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+RESTRICT="!test? ( test )"
+
+XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite";
+XSTS_NAME_1="xmlschema2002-01-16"
+XSTS_NAME_2="xmlschema2004-01-14"
+XSTS_TARBALL_1="xsts-2002-01-16.tar.gz"
+XSTS_TARBALL_2="xsts-2004-01-14.tar.gz"
+XMLCONF_TARBALL="xmlts20080827.tar.gz"
+
+SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
+   https://dev.gentoo.org/~leio/distfiles/${P}-patchset.tar.xz
+   test? (
+   ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
+   ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
+   http://www.w3.org/XML/Test/${XMLCONF_TARBALL} )"
+
+RDEPEND="
+   >=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]
+   icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
+   lzma? ( >=app-arch/xz-utils-5.0.5-r1:=[${MULTILIB_USEDEP}] )
+   python? ( ${PYTHON_DEPS} )
+   readline? ( sys-libs/readline:= )
+"
+DEPEND="${RDEPEND}
+   dev-util/gtk-doc-am
+   virtual/pkgconfig
+   hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
+"
+
+S="${WORKDIR}/${PN}-${PV%_rc*}"
+
+MULTILIB_CHOST_TOOLS=(
+   /usr/bin/xml2-config
+)
+
+src_unpack() {
+   # ${A} isn't used to avoid unpacking of test tarballs into $WORKDIR,
+   # as they are needed as tarballs in ${S}/xstc instead and not unpacked
+   unpack ${P/_rc/-rc}.tar.gz
+   unpack ${P}-patchset.tar.xz
+   cd "${S}" || die
+
+   if use test; then
+   cp "${DISTDIR}/${XSTS_TARBALL_1}" \
+   "${DISTDIR}/${XSTS_TARBALL_2}" \
+   "${S}"/xstc/ \
+   || die "Failed to install test tarballs"
+   unpack ${XMLCONF_TARBALL}
+   fi
+}
+
+src_prepare() {
+   default
+
+   DOCS=( AUTHORS ChangeLog NEWS README* TODO* )
+
+   # Selec

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2019-03-30 Thread Mart Raudsepp
commit: 588a79fdf708601c7f512ddbb52394c4cc425f95
Author: Mart Raudsepp  gentoo  org>
AuthorDate: Sat Mar 30 20:56:45 2019 +
Commit: Mart Raudsepp  gentoo  org>
CommitDate: Sat Mar 30 20:56:45 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=588a79fd

dev-libs/libxml2: remove old

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Mart Raudsepp  gentoo.org>

 dev-libs/libxml2/Manifest  |   1 -
 .../files/libxml2-2.9.8-CVE-2017-8872.patch|  65 --
 .../files/libxml2-2.9.8-CVE-2018-14404.patch   |  54 -
 .../files/libxml2-2.9.8-CVE-2018-14567.patch   |  50 -
 dev-libs/libxml2/libxml2-2.9.8-r1.ebuild   | 225 -
 dev-libs/libxml2/libxml2-2.9.8.ebuild  | 213 ---
 6 files changed, 608 deletions(-)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index 34ec74aa101..7c58d04e3ed 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,4 +1,3 @@
-DIST libxml2-2.9.8.tar.gz 5469097 BLAKE2B 
0b7836db46edebf6e7108c28da4bb7e3fb5ddc695aaa3e456ba51a66c0294a741d7b60eb4c31c7040443bbd54712c019424078bd533856a9650b39a703a926d5
 SHA512 
28903282c7672206effa1362fd564cbe4cf5be44264b083a7d14e383f73bccd1b81bcafb5f4f2f56f5e7e05914c660e27668c9ce91b1b9f256ef5358d55ba917
 DIST libxml2-2.9.9-patchset.tar.xz 16792 BLAKE2B 
f761b5cda41d57543dadf2cdd8915b69727a818f31badc1092903a9e4341b807852fed0887e9ec7a06a0c19c4a49f9afc2f3c048947f21a09006bb51ef8399ef
 SHA512 
c8c0ee6d0a2833e5664aa754f8ba63b9f0bbfda46510507d3a958c33ef55daba8cfb1ca73ebffeb44d411b5f4259fe6e11ef0204ad2deebd1708ebfb
 DIST libxml2-2.9.9.tar.gz 5476717 BLAKE2B 
00a67c38084f2effd5d68d7d3e68f0c96cf4f52eab6d8d9b96dc91f03a84baa132abeaf303a836ff9bbf04f832432a036077316c464398e433c9779d8519074b
 SHA512 
cb7784ba4e72e942614e12e4f83f4ceb275f3d738b30e3b5c1f25edf8e9fa6789e854685974eed95b362049dbf6c8e7357e0327d64c681ed390534ac154e6810
 DIST xmlts20080827.tar.gz 638940 BLAKE2B 
c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7
 SHA512 
7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch 
b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch
deleted file mode 100644
index 6062f63df9e..000
--- a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-https://bugs.gentoo.org/618110
-https://bugzilla.gnome.org/show_bug.cgi?id=775200
-https://gitlab.gnome.org/GNOME/libxml2/issues/26
-
-From 123234f2cfcd9e9b9f83047eee1dc17b4c3f4407 Mon Sep 17 00:00:00 2001
-From: Nick Wellnhofer 
-Date: Tue, 11 Sep 2018 14:52:07 +0200
-Subject: [PATCH] Free input buffer in xmlHaltParser
-
-This avoids miscalculation of available bytes.
-
-Thanks to Yunho Kim for the report.
-
-Closes: #26

- parser.c |  5 +
- result/errors/759573.xml.err | 17 +++--
- 2 files changed, 12 insertions(+), 10 deletions(-)
-
-diff --git a/parser.c b/parser.c
-index ca9fde2c8758..5813a6643e15 100644
 a/parser.c
-+++ b/parser.c
-@@ -12462,7 +12462,12 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
-   ctxt->input->free((xmlChar *) ctxt->input->base);
-   ctxt->input->free = NULL;
-   }
-+if (ctxt->input->buf != NULL) {
-+xmlFreeParserInputBuffer(ctxt->input->buf);
-+ctxt->input->buf = NULL;
-+}
-   ctxt->input->cur = BAD_CAST"";
-+ctxt->input->length = 0;
-   ctxt->input->base = ctxt->input->cur;
- ctxt->input->end = ctxt->input->cur;
- }
-diff --git a/result/errors/759573.xml.err b/result/errors/759573.xml.err
-index 554039f65b91..38ef5c40b8e3 100644
 a/result/errors/759573.xml.err
-+++ b/result/errors/759573.xml.err
-@@ -21,14 +21,11 @@ Entity: line 1:
- ^
- ./test/errors/759573.xml:1: parser error : internal error: 
xmlParseInternalSubset: error detected in Markup declaration
- 
--
-Date: Mon, 30 Jul 2018 12:54:38 +0200
-Subject: [PATCH] Fix nullptr deref with XPath logic ops
-
-If the XPath stack is corrupted, for example by a misbehaving extension
-function, the "and" and "or" XPath operators could dereference NULL
-pointers. Check that the XPath stack isn't empty and optimize the
-logic operators slightly.
-
-Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/5
-
-Also see
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901817
-https://bugzilla.redhat.com/show_bug.cgi?id=1595985
-
-This is CVE-2018-14404.
-
-Thanks to Guy Inbar for the report.

- xpath.c | 10 --
- 1 file changed, 4 insertions(+), 6 deletions(-)
-
-diff --git a/xpath.c b/xpath.c
-index 3fae0bf4e0a0..5e3bb9ff6401 100644
 a/xpath.c
-+++ b/xpath.c
-@@ -13234,9 +13234,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, 
xmlXPathStepOpPtr

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2019-01-03 Thread Mike Frysinger
commit: 2ad6bf6d6f3dbe00df33a5399c6762fb0ae1867f
Author: Mike Frysinger  chromium  org>
AuthorDate: Thu Jan  3 11:08:40 2019 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Thu Jan  3 11:21:38 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ad6bf6d

dev-libs/libxml2: fix CVE-2017-8872 #618110

Bug: https://bugs.gentoo.org/618110
Signed-off-by: Mike Frysinger  gentoo.org>

 .../files/libxml2-2.9.8-CVE-2017-8872.patch|  65 ++
 dev-libs/libxml2/libxml2-2.9.8-r1.ebuild   | 217 +
 2 files changed, 282 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch 
b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch
new file mode 100644
index 000..6062f63df9e
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch
@@ -0,0 +1,65 @@
+https://bugs.gentoo.org/618110
+https://bugzilla.gnome.org/show_bug.cgi?id=775200
+https://gitlab.gnome.org/GNOME/libxml2/issues/26
+
+From 123234f2cfcd9e9b9f83047eee1dc17b4c3f4407 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer 
+Date: Tue, 11 Sep 2018 14:52:07 +0200
+Subject: [PATCH] Free input buffer in xmlHaltParser
+
+This avoids miscalculation of available bytes.
+
+Thanks to Yunho Kim for the report.
+
+Closes: #26
+---
+ parser.c |  5 +
+ result/errors/759573.xml.err | 17 +++--
+ 2 files changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/parser.c b/parser.c
+index ca9fde2c8758..5813a6643e15 100644
+--- a/parser.c
 b/parser.c
+@@ -12462,7 +12462,12 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
+   ctxt->input->free((xmlChar *) ctxt->input->base);
+   ctxt->input->free = NULL;
+   }
++if (ctxt->input->buf != NULL) {
++xmlFreeParserInputBuffer(ctxt->input->buf);
++ctxt->input->buf = NULL;
++}
+   ctxt->input->cur = BAD_CAST"";
++ctxt->input->length = 0;
+   ctxt->input->base = ctxt->input->cur;
+ ctxt->input->end = ctxt->input->cur;
+ }
+diff --git a/result/errors/759573.xml.err b/result/errors/759573.xml.err
+index 554039f65b91..38ef5c40b8e3 100644
+--- a/result/errors/759573.xml.err
 b/result/errors/759573.xml.err
+@@ -21,14 +21,11 @@ Entity: line 1:
+ ^
+ ./test/errors/759573.xml:1: parser error : internal error: 
xmlParseInternalSubset: error detected in Markup declaration
+ 
+-http://www.xmlsoft.org/";
+
+LICENSE="MIT"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 
~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux 
~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris 
~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug examples icu ipv6 lzma python readline static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite";
+XSTS_NAME_1="xmlschema2002-01-16"
+XSTS_NAME_2="xmlschema2004-01-14"
+XSTS_TARBALL_1="xsts-2002-01-16.tar.gz"
+XSTS_TARBALL_2="xsts-2004-01-14.tar.gz"
+XMLCONF_TARBALL="xmlts20080827.tar.gz"
+
+SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
+   test? (
+   ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
+   ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
+   http://www.w3.org/XML/Test/${XMLCONF_TARBALL} )"
+
+RDEPEND="
+   >=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]
+   icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
+   lzma? ( >=app-arch/xz-utils-5.0.5-r1:=[${MULTILIB_USEDEP}] )
+   python? ( ${PYTHON_DEPS} )
+   readline? ( sys-libs/readline:= )
+"
+DEPEND="${RDEPEND}
+   dev-util/gtk-doc-am
+   virtual/pkgconfig
+   hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
+"
+
+S="${WORKDIR}/${PN}-${PV%_rc*}"
+
+MULTILIB_CHOST_TOOLS=(
+   /usr/bin/xml2-config
+)
+
+src_unpack() {
+   # ${A} isn't used to avoid unpacking of test tarballs into $WORKDIR,
+   # as they are needed as tarballs in ${S}/xstc instead and not unpacked
+   unpack ${P/_rc/-rc}.tar.gz
+   cd "${S}" || die
+
+   if use test; then
+   cp "${DISTDIR}/${XSTS_TARBALL_1}" \
+   "${DISTDIR}/${XSTS_TARBALL_2}" \
+   "${S}"/xstc/ \
+   || die "Failed to install test tarballs"
+   unpack ${XMLCONF_TARBALL}
+   fi
+}
+
+src_prepare() {
+   default
+
+   DOCS=( AUTHORS ChangeLog NEWS README* TODO* )
+
+   # Patches needed for prefix support
+   eapply "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
+
+   eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
+
+   # Fix build for Windows platform
+   # https://bugzilla.gnome.org/show_bug.cgi?id=760456
+   # eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
+
+   # Fix python detection, bug #567066
+   # https://bugzilla.gnome.org/show_bug.cgi?id=760458
+   eapply "${FILESDIR}"/${P

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2019-01-03 Thread Mike Frysinger
commit: 2acfef7fc1cc4d4ccff0783c4b4fc38dfc989226
Author: Micah Morton  chromium  org>
AuthorDate: Fri Oct 19 18:01:18 2018 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Thu Jan  3 11:21:44 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2acfef7f

dev-libs/libxml2: fix CVE-2018-14567

Signed-off-by: Micah Morton  chromium.org>
Signed-off-by: Mike Frysinger  gentoo.org>

 .../files/libxml2-2.9.8-CVE-2018-14567.patch   | 50 ++
 dev-libs/libxml2/libxml2-2.9.8-r1.ebuild   |  4 ++
 2 files changed, 54 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14567.patch 
b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14567.patch
new file mode 100644
index 000..0d289352d2f
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14567.patch
@@ -0,0 +1,50 @@
+From 2240fbf5912054af025fb6e01e26375100275e74 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer 
+Date: Mon, 30 Jul 2018 13:14:11 +0200
+Subject: [PATCH] Fix infinite loop in LZMA decompression
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Check the liblzma error code more thoroughly to avoid infinite loops.
+
+Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/13
+Closes: https://bugzilla.gnome.org/show_bug.cgi?id=794914
+
+This is CVE-2018-9251 and CVE-2018-14567.
+
+Thanks to Dongliang Mu and Simon Wörner for the reports.
+---
+ xzlib.c | 9 +
+ 1 file changed, 9 insertions(+)
+
+diff --git a/xzlib.c b/xzlib.c
+index a839169ef2ec..0ba88cfa849d 100644
+--- a/xzlib.c
 b/xzlib.c
+@@ -562,6 +562,10 @@ xz_decomp(xz_statep state)
+  "internal error: inflate stream corrupt");
+ return -1;
+ }
++/*
++ * FIXME: Remapping a couple of error codes and falling through
++ * to the LZMA error handling looks fragile.
++ */
+ if (ret == Z_MEM_ERROR)
+ ret = LZMA_MEM_ERROR;
+ if (ret == Z_DATA_ERROR)
+@@ -587,6 +591,11 @@ xz_decomp(xz_statep state)
+ xz_error(state, LZMA_PROG_ERROR, "compression error");
+ return -1;
+ }
++if ((state->how != GZIP) &&
++(ret != LZMA_OK) && (ret != LZMA_STREAM_END)) {
++xz_error(state, ret, "lzma error");
++return -1;
++}
+ } while (strm->avail_out && ret != LZMA_STREAM_END);
+ 
+ /* update available output and crc check value */
+-- 
+2.19.1
+

diff --git a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild 
b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
index 1a798958bcb..43da94cafed 100644
--- a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
@@ -88,6 +88,10 @@ src_prepare() {
# https://bugzilla.gnome.org/show_bug.cgi?id=775200
eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2017-8872.patch
 
+   # CVE-2018-14567
+   # https://bugzilla.gnome.org/show_bug.cgi?id=794914
+   eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2018-14567.patch
+
if [[ ${CHOST} == *-darwin* ]] ; then
# Avoid final linking arguments for python modules
sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' configure.ac || die



[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2019-01-03 Thread Mike Frysinger
commit: 3e81bfb6899b407dba3dca6aa76f4cd2a30d6dd7
Author: Xiaoyong Zhou  google  com>
AuthorDate: Tue Dec  4 22:53:14 2018 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Thu Jan  3 11:21:46 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e81bfb6

dev-libs/libxml2: fix CVE-2018-14404

Signed-off-by: Xiaoyong Zhou  google.com>
Signed-off-by: Mike Frysinger  gentoo.org>

 .../files/libxml2-2.9.8-CVE-2018-14404.patch   | 54 ++
 dev-libs/libxml2/libxml2-2.9.8-r1.ebuild   |  4 ++
 2 files changed, 58 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14404.patch 
b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14404.patch
new file mode 100644
index 000..59bfc0fa9b8
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14404.patch
@@ -0,0 +1,54 @@
+From a436374994c47b12d5de1b8b1d191a098fa23594 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer 
+Date: Mon, 30 Jul 2018 12:54:38 +0200
+Subject: [PATCH] Fix nullptr deref with XPath logic ops
+
+If the XPath stack is corrupted, for example by a misbehaving extension
+function, the "and" and "or" XPath operators could dereference NULL
+pointers. Check that the XPath stack isn't empty and optimize the
+logic operators slightly.
+
+Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/5
+
+Also see
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901817
+https://bugzilla.redhat.com/show_bug.cgi?id=1595985
+
+This is CVE-2018-14404.
+
+Thanks to Guy Inbar for the report.
+---
+ xpath.c | 10 --
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/xpath.c b/xpath.c
+index 3fae0bf4e0a0..5e3bb9ff6401 100644
+--- a/xpath.c
 b/xpath.c
+@@ -13234,9 +13234,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, 
xmlXPathStepOpPtr op)
+   return(0);
+   }
+ xmlXPathBooleanFunction(ctxt, 1);
+-arg1 = valuePop(ctxt);
+-arg1->boolval &= arg2->boolval;
+-valuePush(ctxt, arg1);
++if (ctxt->value != NULL)
++ctxt->value->boolval &= arg2->boolval;
+   xmlXPathReleaseObject(ctxt->context, arg2);
+ return (total);
+ case XPATH_OP_OR:
+@@ -13252,9 +13251,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, 
xmlXPathStepOpPtr op)
+   return(0);
+   }
+ xmlXPathBooleanFunction(ctxt, 1);
+-arg1 = valuePop(ctxt);
+-arg1->boolval |= arg2->boolval;
+-valuePush(ctxt, arg1);
++if (ctxt->value != NULL)
++ctxt->value->boolval |= arg2->boolval;
+   xmlXPathReleaseObject(ctxt->context, arg2);
+ return (total);
+ case XPATH_OP_EQUAL:
+-- 
+2.19.1
+

diff --git a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild 
b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
index 43da94cafed..86521ab289a 100644
--- a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
@@ -92,6 +92,10 @@ src_prepare() {
# https://bugzilla.gnome.org/show_bug.cgi?id=794914
eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2018-14567.patch
 
+   # CVE-2018-14404
+   # https://gitlab.gnome.org/GNOME/libxml2/issues/5
+   eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2018-14404.patch
+
if [[ ${CHOST} == *-darwin* ]] ; then
# Avoid final linking arguments for python modules
sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' configure.ac || die



[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2018-07-25 Thread Mart Raudsepp
commit: 2bea1ac35a4e6955517315078a2176c94cb4388d
Author: Mart Raudsepp  gentoo  org>
AuthorDate: Wed Jul 25 13:17:56 2018 +
Commit: Mart Raudsepp  gentoo  org>
CommitDate: Wed Jul 25 16:47:08 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2bea1ac3

dev-libs/libxml2: remove old

Package-Manager: Portage-2.3.43, Repoman-2.3.10

 dev-libs/libxml2/Manifest  |   2 -
 .../libxml2/files/libxml2-2.8.0_rc1-winnt.patch|  91 -
 dev-libs/libxml2/libxml2-2.9.6.ebuild  | 208 -
 dev-libs/libxml2/libxml2-2.9.7.ebuild  | 208 -
 4 files changed, 509 deletions(-)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index b8be3f373f7..aed8b4f5a34 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,5 +1,3 @@
-DIST libxml2-2.9.6.tar.gz 5469624 BLAKE2B 
cb8fc74044876b2ddf9742a4a84d685ce6cd1e41a991ee79fd70a9175c54d2a9a3d3a2c3229a4ce177fcd4e30b0cee08c7cf3a36fef68b179db0ce521fbbf3b0
 SHA512 
5ef80f895374bd5dd3bcd5f00c715795f026bf45d998f8f762c0cdb739b8755e01de40cf853d98a3826eacef95c4adebe4777db11020e8d98d0bda921f55a0ed
-DIST libxml2-2.9.7.tar.gz 5467389 BLAKE2B 
e15082fb87fb41a7aab6f39120b1d1bbd0325af8009bb3b74c69a98bf7347a39f59055762df157dcf223a79ac84f17535cb40af0a9a461ee3d2c1d55f4832e1b
 SHA512 
da06cb7c5032ef4b7c8e902fabb9d2c74634c42c161be07a7c66a00d53a68029f89b0d4de32a6b9d4ff338c2d1d9c4e53aefb9cf50cb1c2d6c6b06b442ef42d5
 DIST libxml2-2.9.8.tar.gz 5469097 BLAKE2B 
0b7836db46edebf6e7108c28da4bb7e3fb5ddc695aaa3e456ba51a66c0294a741d7b60eb4c31c7040443bbd54712c019424078bd533856a9650b39a703a926d5
 SHA512 
28903282c7672206effa1362fd564cbe4cf5be44264b083a7d14e383f73bccd1b81bcafb5f4f2f56f5e7e05914c660e27668c9ce91b1b9f256ef5358d55ba917
 DIST xmlts20080827.tar.gz 638940 BLAKE2B 
c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7
 SHA512 
7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d
 DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 
1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25
 SHA512 
43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288

diff --git a/dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch 
b/dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch
deleted file mode 100644
index cce3ecb058a..000
--- a/dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 168e20836fe9614dd2dd4b42006c17a783f11c48 Mon Sep 17 00:00:00 2001
-From: Markus Duft 
-Date: Thu, 20 Nov 2008 11:04:33 -0500
-Subject: [PATCH] Fix for ~x86-winnt
-
-[Alexandre Rostovtsev : port to 2.8.0-rc1]

- dict.c|2 +-
- include/wsockcompat.h |2 +-
- nanohttp.c|2 +-
- xmlIO.c   |4 
- 4 files changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/dict.c b/dict.c
-index 3579f64..71e7bc6 100644
 a/dict.c
-+++ b/dict.c
-@@ -47,7 +47,7 @@
- #else
- #ifdef HAVE_INTTYPES_H
- #include 
--#elif defined(WIN32)
-+#elif defined(WIN32) || defined (__PARITY__)
- typedef unsigned __int32 uint32_t;
- #endif
- #endif
-diff --git a/include/wsockcompat.h b/include/wsockcompat.h
-index c762a64..1ed822b 100644
 a/include/wsockcompat.h
-+++ b/include/wsockcompat.h
-@@ -27,7 +27,7 @@
- #endif
- #endif
- 
--#if defined( __MINGW32__ ) || defined( _MSC_VER )
-+#if defined( __MINGW32__ ) || defined( _MSC_VER ) || defined(__PARITY__)
- /* Include  here to ensure that it doesn't get included later
-  * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */
- #include 
-diff --git a/nanohttp.c b/nanohttp.c
-index 2437fed..dbe97a7 100644
 a/nanohttp.c
-+++ b/nanohttp.c
-@@ -74,7 +74,7 @@
- #define XML_SOCKLEN_T unsigned int
- #endif
- 
--#if defined(__MINGW32__) || defined(_WIN32_WCE)
-+#if defined(__MINGW32__) || defined(_WIN32_WCE) || defined(__PARITY__)
- #ifndef _WINSOCKAPI_
- #define _WINSOCKAPI_
- #endif
-diff --git a/xmlIO.c b/xmlIO.c
-index 73a995d..99562f6 100644
 a/xmlIO.c
-+++ b/xmlIO.c
-@@ -47,6 +47,7 @@
- #include  /* for CP_UTF8 */
- #endif
- 
-+#ifndef __PARITY__
- /* Figure a portable way to know if a file is a directory. */
- #ifndef HAVE_STAT
- #  ifdef HAVE__STAT
-@@ -82,6 +83,7 @@
- #endif
- #  endif
- #endif
-+#endif /* __PARITY__ */
- 
- #include 
- #include 
-@@ -657,6 +659,7 @@ xmlWrapStatUtf8(const char *path,struct stat *info)
- {
- #ifdef HAVE_STAT
- int retval = -1;
-+#ifndef __PARITY__
- wchar_t *wPath;
- 
- wPath = __xmlIOWin32UTF8ToWChar(path);
-@@ -665,6 +668,7 @@ xmlWrapStatUtf8(const char *path,struct stat *info)
-retval = _wstat(wPath,info);
-xmlFree(wPath);
- }
-+#endif
- /* maybe path in native encoding *

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/

2015-11-29 Thread Justin Lecher
commit: be2fe913ffa1d4acfeeba02f88adfb3d06481095
Author: Justin Lecher  gentoo  org>
AuthorDate: Sun Nov 29 11:58:28 2015 +
Commit: Justin Lecher  gentoo  org>
CommitDate: Sun Nov 29 11:58:44 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be2fe913

dev-libs/libxml2: Fix python ABI detection

Gentoo recently moved closer to upstream in terms of naming python
with regards to the build ABI. This patch adopts the buildsystem
to this change

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=567066

Package-Manager: portage-2.2.25
Signed-off-by: Justin Lecher  gentoo.org>

 .../libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch | 16 
 dev-libs/libxml2/libxml2-2.9.2-r4.ebuild |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch 
b/dev-libs/libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch
new file mode 100644
index 000..14dd5bc
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch
@@ -0,0 +1,16 @@
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 14ac0a8..f787b12 100644
+--- a/configure.ac
 b/configure.ac
+@@ -844,7 +844,7 @@ if test "$with_python" != "no" ; then
+ fi
+ if test "$PYTHON" != ""
+ then
+-PYTHON_VERSION=`$PYTHON -c "from distutils import sysconfig; 
print(sysconfig.get_python_version())"`
++PYTHON_VERSION=`$PYTHON -c "import sysconfig; 
print(sysconfig.get_config_var('LDVERSION') or 
sysconfig.get_config_var('py_version_short'))"`
+   PYTHON_INCLUDES=`$PYTHON -c "from distutils import sysconfig; 
print(sysconfig.get_python_inc())"`
+ # does not work as it produce a /usr/lib/python path instead 
of/usr/lib64/python
+ #

diff --git a/dev-libs/libxml2/libxml2-2.9.2-r4.ebuild 
b/dev-libs/libxml2/libxml2-2.9.2-r4.ebuild
index d1f80f0..421a205 100644
--- a/dev-libs/libxml2/libxml2-2.9.2-r4.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.2-r4.ebuild
@@ -90,6 +90,8 @@ src_prepare() {
# https://bugs.gentoo.org/show_bug.cgi?id=738751
epatch "${FILESDIR}"/${PN}-2.9.2-icu-pkgconfig.patch
 
+   epatch "${FILESDIR}"/${P}-python-ABIFLAG.patch
+
# Important patches from master
epatch \
"${FILESDIR}"/${PN}-2.9.2-revert-missing-initialization.patch \