Skip to content

Commit

Permalink
gh-101967: add a missing error check (#101968)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eclips4 authored Feb 18, 2023
1 parent 7f1c721 commit 89413bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix possible segfault in ``positional_only_passed_as_keyword`` function, when new list created.
4 changes: 3 additions & 1 deletion Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,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_localsplusnames, k);

Expand Down

0 comments on commit 89413bb

Please sign in to comment.