Skip to content

Commit

Permalink
Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630)
Browse files Browse the repository at this point in the history
_pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1.
(cherry picked from commit 4b430e5)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
  • Loading branch information
miss-islington and ZackerySpytz committed Sep 29, 2018
1 parent 5d33ee1 commit 207bb5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/_pickle.c
Expand Up @@ -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);
Expand Down

0 comments on commit 207bb5f

Please sign in to comment.