]> granicus.if.org Git - python/commitdiff
Issue #16856: Fix a segmentation fault from calling repr() on a dict with
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 4 Jan 2013 10:39:34 +0000 (12:39 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 4 Jan 2013 10:39:34 +0000 (12:39 +0200)
a key whose repr raise an exception.

Misc/NEWS
Objects/unicodeobject.c

index 41126a6e436d5376fdd27ac90cb6b3d128ee23ce..5741620f113e3bc792c19b064474f68c99881fc3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 3.3.1?
 Core and Builtins
 -----------------
 
+- Issue #16856: Fix a segmentation fault from calling repr() on a dict with
+  a key whose repr raise an exception.
+
 - Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB.
 
 - Issue #16455: On FreeBSD and Solaris, if the locale is C, the
index 3b307ed1d9b12e3425515e81a44607572828c827..1522a16ba6e34a81c2c45325623b3e3971694038 100644 (file)
@@ -10672,7 +10672,7 @@ PyUnicode_Append(PyObject **p_left, PyObject *right)
         return;
     }
     left = *p_left;
-    if (right == NULL || !PyUnicode_Check(left)) {
+    if (right == NULL || left == NULL || !PyUnicode_Check(left)) {
         if (!PyErr_Occurred())
             PyErr_BadInternalCall();
         goto error;