mirror of https://github.com/python/cpython
Fix possible NULL pointer dereference in _PyThread_CurrentFrames (GH-96584)
This commit is contained in:
parent
30cc1901ef
commit
88a7f661ca
|
@ -0,0 +1 @@
|
|||
Fix possible ``NULL`` pointer dereference in ``_PyThread_CurrentFrames``. Patch by Kumar Aditya.
|
|
@ -1413,7 +1413,12 @@ _PyThread_CurrentFrames(void)
|
|||
if (id == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
int stat = PyDict_SetItem(result, id, (PyObject *)_PyFrame_GetFrameObject(frame));
|
||||
PyObject *frameobj = (PyObject *)_PyFrame_GetFrameObject(frame);
|
||||
if (frameobj == NULL) {
|
||||
Py_DECREF(id);
|
||||
goto fail;
|
||||
}
|
||||
int stat = PyDict_SetItem(result, id, frameobj);
|
||||
Py_DECREF(id);
|
||||
if (stat < 0) {
|
||||
goto fail;
|
||||
|
|
Loading…
Reference in New Issue