Skip to content

Commit 89413bb

Browse files
authored
gh-101967: add a missing error check (#101968)
1 parent 7f1c721 commit 89413bb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix possible segfault in ``positional_only_passed_as_keyword`` function, when new list created.

Python/ceval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,9 @@ positional_only_passed_as_keyword(PyThreadState *tstate, PyCodeObject *co,
12551255
{
12561256
int posonly_conflicts = 0;
12571257
PyObject* posonly_names = PyList_New(0);
1258-
1258+
if (posonly_names == NULL) {
1259+
goto fail;
1260+
}
12591261
for(int k=0; k < co->co_posonlyargcount; k++){
12601262
PyObject* posonly_name = PyTuple_GET_ITEM(co->co_localsplusnames, k);
12611263

0 commit comments

Comments
 (0)