]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-134209: use heap-allocated memory in `_curses.window.{instr,getstr}` (GH-134283)
authortigerding <43339228+zydtiger@users.noreply.github.com>
Tue, 20 May 2025 20:36:04 +0000 (16:36 -0400)
committerGitHub <noreply@github.com>
Tue, 20 May 2025 20:36:04 +0000 (20:36 +0000)
commitaadda87b3d3d99cb9e8c8791bb9715a3f0209195
treeff7569cf9303d5d7c4694ae448b2b7bb7683a149
parenta3a3cf6d157948ed64ae837d6310b933a39a2493
gh-134209: use heap-allocated memory in `_curses.window.{instr,getstr}` (GH-134283)

* made curses buffer heap allocated instead of stack
* change docs to explicitly mention the max buffer size
* changing GetStr() function to behave similarly too
* Update Doc/library/curses.rst
* Update instr with proper return error handling
* Update Modules/_cursesmodule.c
* change to strlen and better memory safety
* change from const int to Py_ssize_t
* add mem allocation guard
* update versionchanged to mention it was an increase.
* explicitly use versionchanged 3.14 as that is its own branch now.

TESTED: `python -m test -u curses test_curses`

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Doc/library/curses.rst
Misc/NEWS.d/next/Library/2025-05-19-20-59-06.gh-issue-134209.anhTcF.rst [new file with mode: 0644]
Modules/_cursesmodule.c