summaryrefslogtreecommitdiffstats
path: root/Python/hamt.c
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-01-23 21:26:07 (GMT)
committerGitHub <noreply@github.com>2018-01-23 21:26:07 (GMT)
commit0bad4d63c654d93e1f32ff35026405a3987db5ca (patch)
tree860799a5fbf36f77f1dbd68a8ee98819b773f006 /Python/hamt.c
parent9d411c119fdd8e42209ec16be27686a843507f18 (diff)
downloadcpython-0bad4d63c654d93e1f32ff35026405a3987db5ca.zip
cpython-0bad4d63c654d93e1f32ff35026405a3987db5ca.tar.gz
cpython-0bad4d63c654d93e1f32ff35026405a3987db5ca.tar.bz2
bpo-32436: Fix potential NULL dereference (#5286)
Diffstat (limited to 'Python/hamt.c')
-rw-r--r--Python/hamt.c4
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 */