aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-01-23 16:26:07 -0500
committerGitHub <noreply@github.com>2018-01-23 16:26:07 -0500
commit0bad4d63c654d93e1f32ff35026405a3987db5ca (patch)
tree860799a5fbf36f77f1dbd68a8ee98819b773f006 /Python/hamt.c
parentbpo-32296: Make get_running_loop() another 4-5x faster (#5277) (diff)
downloadcpython-0bad4d63c654d93e1f32ff35026405a3987db5ca.tar.gz
cpython-0bad4d63c654d93e1f32ff35026405a3987db5ca.tar.bz2
cpython-0bad4d63c654d93e1f32ff35026405a3987db5ca.zip
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 eb69fdd136b..af3dfce43c8 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 */