summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2008-08-15 03:07:47 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2008-08-15 03:07:47 (GMT)
commit1f9d907c9009daf169d5d6fcdcef72f85fc6f3ac (patch)
tree7c223ce1e52c1472222c879bb30bf9baa3976490 /Modules/_pickle.c
parente1e48ea29bc04cff9739f6ab4cb991604060a55f (diff)
downloadcpython-1f9d907c9009daf169d5d6fcdcef72f85fc6f3ac.zip
cpython-1f9d907c9009daf169d5d6fcdcef72f85fc6f3ac.tar.gz
cpython-1f9d907c9009daf169d5d6fcdcef72f85fc6f3ac.tar.bz2
Issue 3514: Fixed segfault dues to infinite loop in __getattr__.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r--Modules/_pickle.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 0f5b06b..52fa156 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -3834,8 +3834,11 @@ load_build(UnpicklerObject *self)
inst = self->stack->data[self->stack->length - 1];
setstate = PyObject_GetAttrString(inst, "__setstate__");
- if (setstate == NULL && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Clear();
+ if (setstate == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_AttributeError))
+ PyErr_Clear();
+ else
+ return -1;
}
else {
PyObject *result;