From afd400fa5ab51b6554157012ec130ea852e3be15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=81=D1=82=D0=B0=D1=81=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=9A=D0=BE=D0=BB=D1=8C=D1=86=D0=BE=D0=B2=D0=B0?= Date: Tue, 30 Jan 2024 01:42:23 +0300 Subject: [PATCH 1/2] Fix possible segfault in positional_only_passed_as_keyword function, when new list created. --- Python/ceval.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Python/ceval.c b/Python/ceval.c index 9a61f8a3c3cf50..cb5586645d40a7 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4013,7 +4013,9 @@ positional_only_passed_as_keyword(PyThreadState *tstate, PyCodeObject *co, { int posonly_conflicts = 0; PyObject* posonly_names = PyList_New(0); - + if (posonly_names == NULL) { + goto fail; + } for(int k=0; k < co->co_posonlyargcount; k++){ PyObject* posonly_name = PyTuple_GET_ITEM(co->co_varnames, k); From d41ade89f691e4354ce31f70d22104d469621add Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 22:58:35 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2024-01-29-22-58-34.gh-issue-101968.37TdDg.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2024-01-29-22-58-34.gh-issue-101968.37TdDg.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-01-29-22-58-34.gh-issue-101968.37TdDg.rst b/Misc/NEWS.d/next/Core and Builtins/2024-01-29-22-58-34.gh-issue-101968.37TdDg.rst new file mode 100644 index 00000000000000..6e681f910f5359 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2024-01-29-22-58-34.gh-issue-101968.37TdDg.rst @@ -0,0 +1 @@ +Fix possible segfault in ``positional_only_passed_as_keyword`` function, when new list created.