| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + Fix possible ``NULL`` pointer dereference in ``_PyThread_CurrentFrames``. Patch by Kumar Aditya. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1398,7 +1398,12 @@ _PyThread_CurrentFrames(void) | |||
| 1398 | 1398 | if (id == NULL) { | |
| 1399 | 1399 | goto fail; | |
| 1400 | 1400 | } | |
| 1401 | - int stat = PyDict_SetItem(result, id, (PyObject *)_PyFrame_GetFrameObject(frame)); | ||
| 1401 | + PyObject *frameobj = (PyObject *)_PyFrame_GetFrameObject(frame); | ||
| 1402 | + if (frameobj == NULL) { | ||
| 1403 | + Py_DECREF(id); | ||
| 1404 | + goto fail; | ||
| 1405 | + } | ||
| 1406 | + int stat = PyDict_SetItem(result, id, frameobj); | ||
| 1402 | 1407 | Py_DECREF(id); | |
| 1403 | 1408 | if (stat < 0) { | |
| 1404 | 1409 | goto fail; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments