GNOME Bugzilla – Bug 791691
libxml2-2.9.7 Python 3 binding: non-UTF-8 string => segfault
Last modified: 2019-11-05 21:02:36 UTC
Created attachment 365632 [details] [review] Patch that fixes this NULL dereference If an XML error occurs in a file that is not encoded in UTF-8 (the failing source example here was itstool generating the Czech translation of Gnumeric's documentation), PyUnicode_FromString can return NULL. Since message is passed as argument 1 to the error callback when set, the Python interpreter will crash trying to handle the argument list if this happens. Attached is a patch that checks for message being NULL and sets it to Py_None like libxml_charPtrConstWrap would if str was NULL. This is completely unrelated to bug 789813, but was found on Adélie Linux, a derivative of Alpine. (gdb) bt
+ Trace 238265
*** This bug has been marked as a duplicate of bug 789714 ***