-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
genericaliasobject.c: Two NULL dereference bugs #148222
Copy link
Copy link
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Parent: #146102
https://gist.github.com/devdanzin/266ca45099796a2373866a07447d5ebf
Summary
ga_vectorcall(line 653):PyVectorcall_Function(alias->origin)can return NULL, immediately called as function pointer → segfault._Py_make_parameters(line 243-245): After_PyTuple_Resizefails,parametersis NULL butPy_DECREF(parameters)is called → crash.
Fix
- Add NULL check and fallback to
PyObject_Vectorcall. - Change
Py_DECREF(parameters)toPy_XDECREF(parameters)at line 245.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error