Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-1621: Avoid signed integer overflow in set_table_resize(). #9059

Merged
merged 2 commits into from
Sep 11, 2018

Conversation

sir-sigurd
Copy link
Contributor

@sir-sigurd sir-sigurd commented Sep 4, 2018

Address a C undefined behavior signed integer overflow issue in set object table resizing. Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings.

https://bugs.python.org/issue1621

@miss-islington
Copy link
Contributor

@sir-sigurd: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 6c7d67c into python:master Sep 11, 2018
@miss-islington
Copy link
Contributor

Thanks @sir-sigurd for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 11, 2018
…nGH-9059)

Address a C undefined behavior signed integer overflow issue in set object table resizing.  Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings.

<!-- issue-number: [bpo-1621](https://www.bugs.python.org/issue1621) -->
https://bugs.python.org/issue1621
<!-- /issue-number -->
(cherry picked from commit 6c7d67c)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
@bedevere-bot
Copy link

GH-9198 is a backport of this pull request to the 3.7 branch.

@bedevere-bot
Copy link

GH-9199 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 11, 2018
…nGH-9059)

Address a C undefined behavior signed integer overflow issue in set object table resizing.  Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings.

<!-- issue-number: [bpo-1621](https://www.bugs.python.org/issue1621) -->
https://bugs.python.org/issue1621
<!-- /issue-number -->
(cherry picked from commit 6c7d67c)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
@sir-sigurd sir-sigurd deleted the set-mask-overflow branch September 12, 2018 00:12
@gpshead
Copy link
Member

gpshead commented Sep 12, 2018

In person conversation with @rhettinger here: this change appears correct. size_t newsize matches the type actually expected by the PyMem_MALLOC() call using it below.

vstinner pushed a commit that referenced this pull request Oct 19, 2018
…) (GH-9199)

Address a C undefined behavior signed integer overflow issue in set object table resizing.  Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings.

(cherry picked from commit 6c7d67c)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
vstinner pushed a commit that referenced this pull request Oct 19, 2018
… (GH-9198)

Address a C undefined behavior signed integer overflow issue in set object table resizing.  Our -fwrapv compiler flag and practical reasons why sets are unlikely to get this large should mean this was never an issue but it was incorrect code that generates code analysis warnings.

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants