summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-04 10:39:34 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-04 10:39:34 (GMT)
commit6c83e739d7b1690f8763b2437266effa71173324 (patch)
tree12acc97efcdcc623e2a3fd8db90b4eb78cccb7bb /Objects/unicodeobject.c
parentbf064b391102b0cf1a79c08c64855a036c957650 (diff)
downloadcpython-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.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
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;