]> granicus.if.org Git - python/commitdiff
Fix segfault in pyexpat.c caused by 84375
authorChristian Heimes <christian@cheimes.de>
Sat, 29 Jun 2013 19:49:27 +0000 (21:49 +0200)
committerChristian Heimes <christian@cheimes.de>
Sat, 29 Jun 2013 19:49:27 +0000 (21:49 +0200)
u can be NULL, use XDECREF

Modules/pyexpat.c

index 303934709a323d22f51ffa82015ff1abf1a3acf1..067b775924d5a2afde1174f382325105a4da0e7f 100644 (file)
@@ -1129,7 +1129,7 @@ PyUnknownEncodingHandler(void *encodingHandlerData,
 
     u = PyUnicode_Decode((char*) template_buffer, 256, name, "replace");
     if (u == NULL || PyUnicode_READY(u)) {
-        Py_DECREF(u);
+        Py_XDECREF(u);
         return XML_STATUS_ERROR;
     }