mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
gh-101967: add a missing error check (#101968)
This commit is contained in:
parent
7f1c721756
commit
89413bbccb
2 changed files with 4 additions and 1 deletions
|
@ -0,0 +1 @@
|
||||||
|
Fix possible segfault in ``positional_only_passed_as_keyword`` function, when new list created.
|
|
@ -1255,7 +1255,9 @@ positional_only_passed_as_keyword(PyThreadState *tstate, PyCodeObject *co,
|
||||||
{
|
{
|
||||||
int posonly_conflicts = 0;
|
int posonly_conflicts = 0;
|
||||||
PyObject* posonly_names = PyList_New(0);
|
PyObject* posonly_names = PyList_New(0);
|
||||||
|
if (posonly_names == NULL) {
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
for(int k=0; k < co->co_posonlyargcount; k++){
|
for(int k=0; k < co->co_posonlyargcount; k++){
|
||||||
PyObject* posonly_name = PyTuple_GET_ITEM(co->co_localsplusnames, k);
|
PyObject* posonly_name = PyTuple_GET_ITEM(co->co_localsplusnames, k);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue