From: Yury Selivanov Date: Tue, 23 Jan 2018 21:26:07 +0000 (-0500) Subject: bpo-32436: Fix potential NULL dereference (#5286) X-Git-Tag: v3.7.0b1~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bad4d63c654d93e1f32ff35026405a3987db5ca;p=python bpo-32436: Fix potential NULL dereference (#5286) --- diff --git a/Python/hamt.c b/Python/hamt.c index eb69fdd136..af3dfce43c 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 */