From: Georg Brandl Date: Fri, 15 Oct 2010 16:26:08 +0000 (+0000) Subject: #9054: fix crash when using pyexpat with a system expat lib version 2.0.1. X-Git-Tag: v3.2a4~555 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c01537f742c3d2591016ef29bb20e3a26482be78;p=thirdparty%2FPython%2Fcpython.git #9054: fix crash when using pyexpat with a system expat lib version 2.0.1. --- diff --git a/Misc/NEWS b/Misc/NEWS index abba90d079cd..6f3d36f3f4dc 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -66,6 +66,9 @@ Library Extensions ---------- +- Issue #9054: Fix a crash occurring when using the pyexpat module + with expat version 2.0.1. + - Issue #5355: Provide mappings from Expat error numbers to string descriptions and backwards, in order to actually make it possible to analyze error codes provided by ExpatError. diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index a8b0f8f858bd..5aadcc01e152 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -351,6 +351,9 @@ call_character_handler(xmlparseobject *self, const XML_Char *buffer, int len) PyObject *args; PyObject *temp; + if (!have_handler(self, CharacterData)) + return -1; + args = PyTuple_New(1); if (args == NULL) return -1;