]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-134209: use heap-allocated memory in `_curses.window.{instr,getstr}` (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 20 May 2025 21:01:45 +0000 (23:01 +0200)
committerGitHub <noreply@github.com>
Tue, 20 May 2025 21:01:45 +0000 (14:01 -0700)
commit04829d4d87659da7f2239cbe15000824bfb9c2d3
tree64466d687f9aa9caf049832990557f651d978abf
parent379805d03c7e2b3a19484c8247fad8da86b5a157
[3.14] gh-134209: use heap-allocated memory in `_curses.window.{instr,getstr}` (GH-134283) (#134391)

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`

---------
(cherry picked from commit aadda87b3d3d99cb9e8c8791bb9715a3f0209195)

Co-authored-by: tigerding <43339228+zydtiger@users.noreply.github.com>
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