]> 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:01:48 +0000 (23:01 -0700)
committerGitHub <noreply@github.com>
Sat, 29 Sep 2018 06:01:48 +0000 (23:01 -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 34ce38c5d3b2c40b4f81a367b3c1a5fbbb56a938..ba8962d686debe66b31d4026f93e8971c213ec9a 100644 (file)
@@ -6804,7 +6804,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);