diff Python/_warnings.c @ 55286:2dab8d63eb55 legacy-trunk

Issue #6415: Fixed warnings.warn sagfault on bad formatted string.
author Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
date Fri, 17 Jul 2009 06:20:46 +0000
parents 9ef683d41c9b
children 1f177818f1d0
line wrap: on
line diff
--- a/Python/_warnings.c	Fri Jul 17 06:17:33 2009 +0000
+++ b/Python/_warnings.c	Fri Jul 17 06:20:46 2009 +0000
@@ -317,6 +317,8 @@
     }
     if (rc == 1) {
         text = PyObject_Str(message);
+        if (text == NULL)
+            goto cleanup;
         category = (PyObject*)message->ob_type;
     }
     else {