summaryrefslogtreecommitdiffstats
path: root/testing/source/libxml2/libxml2-2.12.0-python3-unicode-errors.patch
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2023-12-09 19:55:12 +0000
committer Eric Hameleers <alien@slackware.com>2023-12-09 21:35:16 +0100
commit4f2f8fa3a5c832eb964c3e46084a072ecc592aa4 (patch)
tree3b4599dfea4253dd45b0acd04529f166f6064e53 /testing/source/libxml2/libxml2-2.12.0-python3-unicode-errors.patch
parentb130eee4bfa743a189a08a4da6ea9c28a7b02910 (diff)
downloadcurrent-4f2f8fa3a5c832eb964c3e46084a072ecc592aa4.tar.gz
current-4f2f8fa3a5c832eb964c3e46084a072ecc592aa4.tar.xz
Sat Dec 9 19:55:12 UTC 202320231209195512
kde/plasma-wayland-protocols-1.12.0-x86_64-1.txz: Upgraded. l/libxslt-1.1.39-x86_64-1.txz: Upgraded. l/zxing-cpp-2.2.0-x86_64-1.txz: Upgraded. xap/seamonkey-2.53.18-x86_64-1.txz: Upgraded. This is a bugfix release. For more information, see: https://www.seamonkey-project.org/releases/seamonkey2.53.18 testing/packages/libxml2-2.12.2-x86_64-1.txz: Upgraded. Hey folks, I'm in need of a bit of assistance here. I've had libxml2 on the back burner for quite some time now in spite of yet-another variation of the old "billion laughs" resource exhaustion attack that's been supposedly fixed. The issue I'm running into with newer versions of libxml2 is that the rewrite rules for mapping external entities to files on the system no longer work, and I'm not sure why that is. For a quick demonstration, upgrade to this libxml2 package and then try to build glib2. You'll see xsltproc called to generate documentation such as the man pages, but it isn't able to find the entity locally and fails due to --nonet. I'll be keeping an eye on LQ if anyone has any hints. Thanks!
Diffstat (limited to 'testing/source/libxml2/libxml2-2.12.0-python3-unicode-errors.patch')
-rw-r--r--testing/source/libxml2/libxml2-2.12.0-python3-unicode-errors.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/source/libxml2/libxml2-2.12.0-python3-unicode-errors.patch b/testing/source/libxml2/libxml2-2.12.0-python3-unicode-errors.patch
new file mode 100644
index 000000000..b07e4049f
--- /dev/null
+++ b/testing/source/libxml2/libxml2-2.12.0-python3-unicode-errors.patch
@@ -0,0 +1,34 @@
+diff --git a/python/libxml.c b/python/libxml.c
+index bf048006..5f42e5b7 100644
+--- a/python/libxml.c
++++ b/python/libxml.c
+@@ -1505,6 +1505,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg,
+ PyObject *message;
+ PyObject *result;
+ char str[1000];
++ unsigned char *ptr = (unsigned char *)str;
+
+ if (libxml_xmlPythonErrorFuncHandler == NULL) {
+ va_start(ap, msg);
+@@ -1516,12 +1517,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg,
+ 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 = PyObject_CallObject(libxml_xmlPythonErrorFuncHandler, list);
++ /* Forget any errors caused in the error handler. */
++ PyErr_Clear();
+ Py_XDECREF(list);
+ Py_XDECREF(result);
+ }