From b3d3ee4fef6d1beb547671d12c514c86657b9223 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 23 Nov 2013 21:01:40 +0100 Subject: [PATCH] Issue #17810: Add NULL check to save_frozenset CID 1131949: Dereference null return value (NULL_RETURNS) --- Modules/_pickle.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/_pickle.c b/Modules/_pickle.c index f9aa043a42..b63a7d92c5 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -2940,6 +2940,9 @@ save_frozenset(PicklerObject *self, PyObject *obj) return -1; iter = PyObject_GetIter(obj); + if (iter == NULL) { + return NULL; + } for (;;) { PyObject *item; -- 2.40.0