summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-10-05 05:01:38 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-10-05 05:01:38 (GMT)
commit5a29dd30e0117a59714fa083a946997f2355eede (patch)
tree0960316743c77610bbd62da38ed7701c5edaa4f4 /Modules
parent3adac217627fcd90fc82e3aaa3f141c8d8706324 (diff)
downloadcpython-5a29dd30e0117a59714fa083a946997f2355eede.zip
cpython-5a29dd30e0117a59714fa083a946997f2355eede.tar.gz
cpython-5a29dd30e0117a59714fa083a946997f2355eede.tar.bz2
Fix Coverity #159.
This code was broken if save() returned a negative number since i contained a boolean value and then we compared i < 0 which should never be true. Will backport (assuming it's necessary)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cPickle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index fbf6a12..227f02c 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -2249,7 +2249,7 @@ save_reduce(Picklerobject *self, PyObject *args, PyObject *ob)
Py_INCREF(temp);
PyTuple_SET_ITEM(newargtup, i-1, temp);
}
- i = save(self, newargtup, 0) < 0;
+ i = save(self, newargtup, 0);
Py_DECREF(newargtup);
if (i < 0)
return -1;