]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] `_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158) (#145163)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 24 Feb 2026 01:16:45 +0000 (02:16 +0100)
committerGitHub <noreply@github.com>
Tue, 24 Feb 2026 01:16:45 +0000 (01:16 +0000)
commitdd355045f665fb0fa7f4e4f618e2457a726f6476
tree226c4640fdc4780202db4825ed3950ad19754d01
parent0acd41f398be6cc6015fbb5578c423ea3a8f3182
[3.13] `_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158) (#145163)

`_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158)

Avoid possible undefined behaviour from signed overflow in `struct` module

As discovered via oss-fuzz.
(cherry picked from commit fd0400585eb957c7d10812d87a8cb9e1f3c72519)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Lib/test/test_struct.py
Misc/NEWS.d/next/Library/2026-02-23-20-52-55.gh-issue-145158.vWJtxI.rst [new file with mode: 0644]
Modules/_struct.c