-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixeseasyinterpreter-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:
Pointer tstate is compared to a NULL value here, but above there is a dereference. Stack trace: _PySys_AddWarnOptionWithError -> get_warnoptions -> _PySys_GetAttr. Correct code should look like this:
void
PySys_AddWarnOptionUnicode(PyObject *option)
{
PyThreadState *tstate = _PyThreadState_GET();
if (tstate && _PySys_AddWarnOptionWithError(tstate, option) < 0) {
/* No return value, therefore clear error state if possible */
_PyErr_Clear(tstate);
}
}
CPython versions tested on:
3.11
Operating systems tested on:
No response
Linked PRs
- gh-126108: Fix potential null pointer dereference in PySys_AddWarnOptionUnicode #126118
- [3.13] gh-126108: Fix potential null pointer dereference in
PySys_AddWarnOptionUnicode
(GH-126118) #129520 - [3.12] gh-126108: Fix potential null pointer dereference in
PySys_AddWarnOptionUnicode
(GH-126118) #129522
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixeseasyinterpreter-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