]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#9054: fix crash when using pyexpat with a system expat lib version 2.0.1.
authorGeorg Brandl <georg@python.org>
Fri, 15 Oct 2010 16:26:08 +0000 (16:26 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 15 Oct 2010 16:26:08 +0000 (16:26 +0000)
Misc/NEWS
Modules/pyexpat.c

index abba90d079cd26c4065540a09b4cbd798559fcc7..6f3d36f3f4dc90a0826e854f2895b0f5095f2eb8 100644 (file)
--- 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.
index a8b0f8f858bdf652c152540ddc4d152743bb97ab..5aadcc01e15235328a55799a2c3f0c6644dc589b 100644 (file)
@@ -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;