Skip to content

[3.14] gh-159739: Fix crash in _PyTuple_Resize() with an invalid size (GH-159804) - #159977

Merged
gpshead merged 1 commit into
python:3.14from
miss-islington:backport-c360884-3.14
Oct 21, 2026
Merged

gpshead merged 1 commit into
python:3.14from
miss-islington:backport-c360884-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

_PyTuple_Resize() did not validate newsize for non-empty tuples.

Raise SystemError for a negative size and MemoryError for a too-large size,
like PyTuple_New() already does for the empty-tuple path.
(cherry picked from commit c360884)

Co-authored-by: Gregory P. Smith 68491+gpshead@users.noreply.github.com

…ythonGH-159804)

_PyTuple_Resize() did not validate newsize for non-empty tuples.

Raise SystemError for a negative size and MemoryError for a too-large size,
like PyTuple_New() already does for the empty-tuple path.
(cherry picked from commit c360884)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
@gpshead
gpshead enabled auto-merge (squash) October 20, 2026 23:08
@gpshead
gpshead merged commit 86795c8 into python:3.14 Oct 21, 2026
51 checks passed
@miss-islington
miss-islington deleted the backport-c360884-3.14 branch October 21, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants