[Python-checkins] python/dist/src/Modules pyexpat.c,2.90,2.91
nnorwitz@users.sourceforge.net
nnorwitz at users.sourceforge.net
Fri Sep 30 06:46:53 CEST 2005
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11176/Modules
Modified Files:
pyexpat.c
Log Message:
Patch #1309009, Fix segfault in pyexpat when the XML document is
in latin_1, but Python incorrectly assumes it is in UTF-8 format
Will backport.
Index: pyexpat.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v
retrieving revision 2.90
retrieving revision 2.91
diff -u -d -r2.90 -r2.91
--- pyexpat.c 4 Mar 2005 14:37:01 -0000 2.90
+++ pyexpat.c 30 Sep 2005 04:46:49 -0000 2.91
@@ -417,6 +417,9 @@
{
PyObject *result = STRING_CONV_FUNC(str);
PyObject *value;
+ /* result can be NULL if the unicode conversion failed. */
+ if (!result)
+ return result;
if (!self->intern)
return result;
value = PyDict_GetItem(self->intern, result);
@@ -572,7 +575,9 @@
Py_DECREF(v);
}
}
- args = Py_BuildValue("(NN)", string_intern(self, name), container);
+ args = string_intern(self, name);
+ if (args != NULL)
+ args = Py_BuildValue("(NN)", args, container);
if (args == NULL) {
Py_DECREF(container);
return;
More information about the Python-checkins
mailing list