]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] `_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158) (#145162)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 24 Feb 2026 01:18:32 +0000 (02:18 +0100)
committerGitHub <noreply@github.com>
Tue, 24 Feb 2026 01:18:32 +0000 (01:18 +0000)
commit35a7a6767e9fbda4d4462afe81a3c3c6dca7ef33
tree228a9b6f869afd8616386a5b5247f3311c160708
parent1f3ea5436839e701947f8a472c059d7680591095
[3.14] `_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158) (#145162)

`_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