diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-04 10:39:34 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-01-04 10:39:34 (GMT) |
commit | 6c83e739d7b1690f8763b2437266effa71173324 (patch) | |
tree | 12acc97efcdcc623e2a3fd8db90b4eb78cccb7bb | |
parent | bf064b391102b0cf1a79c08c64855a036c957650 (diff) | |
download | cpython-6c83e739d7b1690f8763b2437266effa71173324.zip cpython-6c83e739d7b1690f8763b2437266effa71173324.tar.gz cpython-6c83e739d7b1690f8763b2437266effa71173324.tar.bz2 |
Issue #16856: Fix a segmentation fault from calling repr() on a dict with
a key whose repr raise an exception.
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -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 diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3b307ed..1522a16 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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; |