diff options
author | Yury Selivanov <yury@magic.io> | 2018-01-23 21:26:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-23 21:26:07 (GMT) |
commit | 0bad4d63c654d93e1f32ff35026405a3987db5ca (patch) | |
tree | 860799a5fbf36f77f1dbd68a8ee98819b773f006 /Python | |
parent | 9d411c119fdd8e42209ec16be27686a843507f18 (diff) | |
download | cpython-0bad4d63c654d93e1f32ff35026405a3987db5ca.zip cpython-0bad4d63c654d93e1f32ff35026405a3987db5ca.tar.gz cpython-0bad4d63c654d93e1f32ff35026405a3987db5ca.tar.bz2 |
bpo-32436: Fix potential NULL dereference (#5286)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/hamt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/hamt.c b/Python/hamt.c index eb69fdd..af3dfce 100644 --- a/Python/hamt.c +++ b/Python/hamt.c @@ -1055,6 +1055,10 @@ hamt_node_bitmap_without(PyHamtNode_Bitmap *self, #endif PyHamtNode_Bitmap *clone = hamt_node_bitmap_clone(self); + if (clone == NULL) { + return W_ERROR; + } + Py_SETREF(clone->b_array[val_idx], (PyObject *)sub_node); /* borrow */ |