Skip to content

_struct.c: Fix UB from integer overflow in prepare_s#145750

Merged
serhiy-storchaka merged 2 commits intopython:mainfrom
StanFromIreland:ub
Mar 10, 2026
Merged

_struct.c: Fix UB from integer overflow in prepare_s#145750
serhiy-storchaka merged 2 commits intopython:mainfrom
StanFromIreland:ub

Conversation

@StanFromIreland
Copy link
Member

Like #145158. I checked the remaining paths in prepare_s and there are no remaining possible cases for UB.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Mar 10, 2026
@serhiy-storchaka serhiy-storchaka merged commit 4d0dce0 into python:main Mar 10, 2026
101 of 104 checks passed
@miss-islington-app
Copy link

Thanks @StanFromIreland for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 10, 2026
…thonGH-145750)

(cherry picked from commit 4d0dce0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@miss-islington-app
Copy link

Sorry, @StanFromIreland and @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 4d0dce0c8ddc4d0321bd590a1a33990edc2e1b08 3.13

@bedevere-app
Copy link

bedevere-app bot commented Mar 10, 2026

GH-145772 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Mar 10, 2026
@StanFromIreland StanFromIreland deleted the ub branch March 10, 2026 16:58
StanFromIreland added a commit to StanFromIreland/cpython that referenced this pull request Mar 10, 2026
…ule (pythonGH-145750)

(cherry picked from commit 4d0dce0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Mar 10, 2026

GH-145777 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Mar 10, 2026
serhiy-storchaka pushed a commit that referenced this pull request Mar 10, 2026
…ule (GH-145750) (GH-145772)

(cherry picked from commit 4d0dce0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
serhiy-storchaka pushed a commit that referenced this pull request Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants