Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630)
https://github.com/python/cpython/commit/4b430e5f6954ef4b248e95bfb4087635dcd... commit: 4b430e5f6954ef4b248e95bfb4087635dcdefc6d branch: master author: Zackery Spytz <zspytz@gmail.com> committer: Serhiy Storchaka <storchaka@gmail.com> date: 2018-09-29T08:48:46+03:00 summary: Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630) _pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1. files: M Modules/_pickle.c diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 3588e33f0971..0e3bd225dbd8 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -6792,7 +6792,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);
participants (1)
-
Serhiy Storchaka