| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
curses.set_term() accepted a screen returned by new_prescr(), which has no terminal attached. Making such a screen current left curses without a terminal, and the next window refresh dereferenced NULL and crashed the interpreter. set_term() now raises curses.error for a screen with no standard window, which is exactly a new_prescr() screen. The documentation already said the argument comes from newterm().
Documentation build overview3 files changed ± library/curses.html ± whatsnew/3.15.html ± whatsnew/changelog.html |
Sorry, something went wrong.
Both from review: the test uses the existing requires_curses_func helper, and the NEWS entry goes away because set_term() and new_prescr() are both new in 3.16 and unreleased, so the crash was never reachable by a user.
There was a problem hiding this comment.
LGTM. 👍
Sorry, something went wrong.
…ythonGH-154750) set_term() accepted a screen returned by new_prescr(), which has no terminal, and the next refresh crashed inside curses. Raise curses.error instead.
| Back | FazBrowse Home | New Git URL |
curses.set_term() only checked that its argument is a screen that has not been
deleted, so it also accepted a screen from curses.new_prescr(). That screen has no
terminal attached, and once it was made current the next window refresh dereferenced
NULL inside curses and killed the interpreter:
set_term() now raises curses.error when the screen has no standard window, which is
exactly what a new_prescr() screen is. The documentation already described the argument
as a screen returned by newterm(), so this makes the code match, and the docs now
mention the exception.
Both functions are new in 3.16 (gh-90092, GH-151748), so no released version is affected
and there is no NEWS entry.
The same reproducer after the change:
Tests: