[Python-checkins] cpython: Issue #17810: Add NULL check to save_frozenset

christian.heimes python-checkins at python.org
Sat Nov 23 21:01:50 CET 2013


http://hg.python.org/cpython/rev/d719975f4d25
changeset:   87444:d719975f4d25
user:        Christian Heimes <christian at cheimes.de>
date:        Sat Nov 23 21:01:40 2013 +0100
summary:
  Issue #17810: Add NULL check to save_frozenset
CID 1131949:  Dereference null return value  (NULL_RETURNS)

files:
  Modules/_pickle.c |  3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/Modules/_pickle.c b/Modules/_pickle.c
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -2940,6 +2940,9 @@
         return -1;
 
     iter = PyObject_GetIter(obj);
+    if (iter == NULL) {
+        return NULL;
+    }
     for (;;) {
         PyObject *item;
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list