]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 29 Sep 2018 06:12:35 +0000 (23:12 -0700)
committerGitHub <noreply@github.com>
Sat, 29 Sep 2018 06:12:35 +0000 (23:12 -0700)
_pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1.
(cherry picked from commit 4b430e5f6954ef4b248e95bfb4087635dcdefc6d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Modules/_pickle.c

index 93bc1c6fee7f3c241bdb714db147ec7c85269c55..0a7e20e10592e1947b61d2377b5ca4a50fe12ec3 100644 (file)
@@ -6713,7 +6713,7 @@ _pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file,
 
     self->stack = (Pdata *)Pdata_New();
     if (self->stack == NULL)
-        return 1;
+        return -1;
 
     self->memo_size = 32;
     self->memo = _Unpickler_NewMemo(self->memo_size);