From 1d55e6e79c9e1296f89f844aaea87f06b71e6a2e Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 4 Nov 2024 09:13:54 -0500 Subject: [PATCH] NULL check for PySlice_New --- Objects/codeobject.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 4e7febc781198d..95584f17cc0af6 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -2477,6 +2477,9 @@ _PyCode_ConstantKey(PyObject *op) } PyObject *slice_key = PySlice_New(start_key, stop_key, step_key); + if (slice_key == NULL) { + return NULL; + } key = PyTuple_Pack(2, slice_key, op); Py_DECREF(slice_key); }