Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

_struct.c: Fix UB from integer overflow inprepare_s#145158

Merged
gpshead merged 2 commits intopython:mainfrom
StanFromIreland:struct-overflow
Feb 24, 2026
Merged

_struct.c: Fix UB from integer overflow inprepare_s#145158
gpshead merged 2 commits intopython:mainfrom
StanFromIreland:struct-overflow

Conversation

@StanFromIreland
Copy link
Member

Caught by OSS-Fuzz, seehttps://issues.oss-fuzz.com/issues/466669135.

stan@stanlaptop:~/dev/cpython{main}$ ./python -c 'import struct; struct.Struct("6107082938247334i9221070829382473344q")'Modules/_struct.c:1681:26: runtime error: signed integer overflow: 6107082938247334 + 9221070829382473344 cannot be represented in type 'long int'Traceback (most recent call last):  File "<string>", line 1, in <module>    import struct; struct.Struct("6107082938247334i9221070829382473344q")                   ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^struct.error: total struct size too long

Skipping news, since there shouldn't be any user-visible change, although I can add one if people prefer.

@gpsheadgpshead added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsFeb 23, 2026
@gpshead
Copy link
Member

I suggest adding a one line news entry.

@StanFromIreland
Copy link
MemberAuthor

I suggest adding a one line news entry.

Done, I used the PR number instead of creating an issue.

gpshead reacted with thumbs up emoji

@gpsheadgpshead merged commitfd04005 intopython:mainFeb 24, 2026
49 checks passed
@miss-islington-app
Copy link

Thanks@StanFromIreland for the PR, and@gpshead 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 requestFeb 24, 2026
…5158)Avoid possible undefined behaviour from signed overflow in `struct` moduleAs discovered via oss-fuzz.(cherry picked from commitfd04005)Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@bedevere-app
Copy link

GH-145162 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelFeb 24, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestFeb 24, 2026
…5158)Avoid possible undefined behaviour from signed overflow in `struct` moduleAs discovered via oss-fuzz.(cherry picked from commitfd04005)Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@bedevere-app
Copy link

GH-145163 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelFeb 24, 2026
gpshead pushed a commit that referenced this pull requestFeb 24, 2026
…45158) (#145163)`_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158)Avoid possible undefined behaviour from signed overflow in `struct` moduleAs discovered via oss-fuzz.(cherry picked from commitfd04005)Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
gpshead pushed a commit that referenced this pull requestFeb 24, 2026
…45158) (#145162)`_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158)Avoid possible undefined behaviour from signed overflow in `struct` moduleAs discovered via oss-fuzz.(cherry picked from commitfd04005)Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@StanFromIrelandStanFromIreland deleted the struct-overflow branchFebruary 24, 2026 07:37
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gpsheadgpsheadgpshead approved these changes

@ammaraskarammaraskarAwaiting requested review from ammaraskar

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@StanFromIreland@gpshead

[8]ページ先頭

©2009-2026 Movatter.jp