mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
faulthandler: fix unregister() if it is called before register()
Fix a crash: don't read from NULL.
This commit is contained in:
parent
7ede59d77a
commit
cfa7123ef1
2 changed files with 5 additions and 1 deletions
|
|
@ -694,6 +694,9 @@ faulthandler_unregister_py(PyObject *self, PyObject *args)
|
|||
if (!check_signum(signum))
|
||||
return NULL;
|
||||
|
||||
if (user_signals == NULL)
|
||||
Py_RETURN_FALSE;
|
||||
|
||||
user = &user_signals[signum];
|
||||
change = faulthandler_unregister(user, signum);
|
||||
return PyBool_FromLong(change);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue