diff options
author | Bénédikt Tran <10796600+picnixz@users.noreply.github.com> | 2024-11-03 15:08:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-03 15:08:34 (GMT) |
commit | 19d935843727fff93b2c0e09a63fd32c0d97098d (patch) | |
tree | c088a7714ed6a7083e7b36cde452fac59b9ceab5 /Modules/_cursesmodule.c | |
parent | dcae5cd6abaae4f73e656ebc054f30d3f15ca7b8 (diff) | |
download | cpython-19d935843727fff93b2c0e09a63fd32c0d97098d.zip cpython-19d935843727fff93b2c0e09a63fd32c0d97098d.tar.gz cpython-19d935843727fff93b2c0e09a63fd32c0d97098d.tar.bz2 |
gh-126313: Fix a crash in curses.napms() due to incorrect error handling (GH-126351)
Diffstat (limited to 'Modules/_cursesmodule.c')
-rw-r--r-- | Modules/_cursesmodule.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 27d5df0..040ffa8 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -3815,8 +3815,11 @@ static int _curses_napms_impl(PyObject *module, int ms) /*[clinic end generated code: output=5f292a6a724491bd input=c6d6e01f2f1df9f7]*/ { - PyCursesStatefulInitialised(module); - + if (!_PyCursesStatefulCheckFunction(module, + curses_initscr_called, + "initscr")) { + return -1; + } return napms(ms); } |