summaryrefslogtreecommitdiff
path: root/harmony/libxml2/python-segfault-fix.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-27 14:34:02 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-27 14:34:02 -0600
commit7553795ec2d735c01dbdde129a65b7f45d5aa999 (patch)
treeb3970009a8246b0c17a105fe6b10c8077fc2b763 /harmony/libxml2/python-segfault-fix.patch
parente2b01859c88d221992403d1293d42da33002be4d (diff)
downloadpackages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.gz
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.bz2
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.tar.xz
packages-7553795ec2d735c01dbdde129a65b7f45d5aa999.zip
Add harmony/ repo for packages still being discussed
See https://wiki.adelielinux.org/wiki/Project:Harmony
Diffstat (limited to 'harmony/libxml2/python-segfault-fix.patch')
-rw-r--r--harmony/libxml2/python-segfault-fix.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/harmony/libxml2/python-segfault-fix.patch b/harmony/libxml2/python-segfault-fix.patch
new file mode 100644
index 000000000..f1f7554eb
--- /dev/null
+++ b/harmony/libxml2/python-segfault-fix.patch
@@ -0,0 +1,36 @@
+Upstream: https://bugzilla.gnome.org/show_bug.cgi?id=791691
+
+From d1ea6250dd00a3b7a92b52a743ec53f7751196e5 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Sat, 16 Dec 2017 19:22:23 -0600
+Subject: [PATCH] Python: if message is NULL, use Py_None instead
+
+If the error message is malformed / invalid UTF-8, and the Python 3
+binding is being used, then message may be NULL. This will cause the
+Python interpreter to crash (Segmentation fault) trying to unpack the
+argument list into local variables.
+
+This uses Py_None for message if message is NULL, so that the
+interpreter does not crash.
+---
+ python/libxml.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/python/libxml.c b/python/libxml.c
+index 5b1ff6e8..dae77b88 100644
+--- a/python/libxml.c
++++ b/python/libxml.c
+@@ -1640,6 +1640,10 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, const char *msg,
+ PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
+ Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
+ message = libxml_charPtrConstWrap(str);
++ if (message == NULL) {
++ Py_INCREF(Py_None);
++ message = Py_None;
++ }
+ PyTuple_SetItem(list, 1, message);
+ result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
+ Py_XDECREF(list);
+--
+2.14.1
+