]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-154751: Fix use-after-free in curses.initscr() after newterm() (GH-154752)
authorVyron Vasileiadis <hi@fedonman.com>
Mon, 27 Jul 2026 18:24:10 +0000 (21:24 +0300)
committerGitHub <noreply@github.com>
Mon, 27 Jul 2026 18:24:10 +0000 (21:24 +0300)
commit92efaff49b100371d66e356b0ab62c35ec7c5fe8
tree34302b228abd55f08b02fd319c3e2dd6dbe8061d
parentb8862aeac3d7cc4ed661c232130cd51c8f691a95
gh-154751: Fix use-after-free in curses.initscr() after newterm() (GH-154752)

initscr() called while a newterm() screen is current returned a second
window object over that screen's standard window, with no reference to
the screen.  Either wrapper could then free the window used by the other.

Return the screen's own standard window instead.
Lib/test/test_curses.py
Modules/_cursesmodule.c