mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
GH-102397: Fix segfault from race condition in signal handling (#102399)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
parent
061325e0d2
commit
1a84cc007e
3 changed files with 21 additions and 0 deletions
|
@ -148,6 +148,10 @@ get_signal_state(PyObject *module)
|
|||
static inline int
|
||||
compare_handler(PyObject *func, PyObject *dfl_ign_handler)
|
||||
{
|
||||
// See https://github.com/python/cpython/pull/102399
|
||||
if (func == NULL || dfl_ign_handler == NULL) {
|
||||
return 0;
|
||||
}
|
||||
assert(PyLong_CheckExact(dfl_ign_handler));
|
||||
if (!PyLong_CheckExact(func)) {
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue