Skip to content

Commit 1633aea

Browse files
miss-islingtonEclips4hauntsaninja
authored
[3.11] gh-101967: add a missing error check (GH-101968) (#102015)
gh-101967: add a missing error check (GH-101968) (cherry picked from commit 89413bb) Co-authored-by: Eclips4 <[email protected]> Co-authored-by: Shantanu <[email protected]>
1 parent 78eee76 commit 1633aea

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
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

+3-1
Original file line numberDiff line numberDiff line change
@@ -6006,7 +6006,9 @@ positional_only_passed_as_keyword(PyThreadState *tstate, PyCodeObject *co,
60066006
{
60076007
int posonly_conflicts = 0;
60086008
PyObject* posonly_names = PyList_New(0);
6009-
6009+
if (posonly_names == NULL) {
6010+
goto fail;
6011+
}
60106012
for(int k=0; k < co->co_posonlyargcount; k++){
60116013
PyObject* posonly_name = PyTuple_GET_ITEM(co->co_localsplusnames, k);
60126014

0 commit comments

Comments
 (0)