Skip to content

bpo-41524: fix pointer bug in PyOS_mystr{n}icmp #21845

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

Merged
merged 3 commits into from
Aug 27, 2020

Conversation

wmeehan
Copy link
Contributor

@wmeehan wmeehan commented Aug 12, 2020

The existing implementations of PyOS_mystrnicmp and PyOS_mystricmp
can increment pointers beyond the end of a string.

This fixes those cases by moving the mutation out of the condition.

https://bugs.python.org/issue41524

The existing implementations of PyOS_mystrnicmp and PyOS_mystricmp
can increment pointers beyond the end of a string.

This commit fixes those cases by moving the mutation out of the condition.
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.

👍

@corona10
Copy link
Member

@wmeehan cc @serhiy-storchaka
I re-opened this PR for the CI

@corona10 corona10 merged commit 97eaf2b into python:master Aug 27, 2020
@miss-islington
Copy link
Contributor

Thanks @wmeehan for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @wmeehan for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 27, 2020
* bpo-41524: fix pointer bug in PyOS_mystr{n}icmp

The existing implementations of PyOS_mystrnicmp and PyOS_mystricmp
can increment pointers beyond the end of a string.

This commit fixes those cases by moving the mutation out of the condition.

* 📜🤖 Added by blurb_it.

* Address comments

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 97eaf2b)

Co-authored-by: wmeehan <wmeehan@users.noreply.github.com>
@bedevere-bot
Copy link

GH-21978 is a backport of this pull request to the 3.9 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Aug 27, 2020
@bedevere-bot
Copy link

GH-21979 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 27, 2020
* bpo-41524: fix pointer bug in PyOS_mystr{n}icmp

The existing implementations of PyOS_mystrnicmp and PyOS_mystricmp
can increment pointers beyond the end of a string.

This commit fixes those cases by moving the mutation out of the condition.

* 📜🤖 Added by blurb_it.

* Address comments

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 97eaf2b)

Co-authored-by: wmeehan <wmeehan@users.noreply.github.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 RHEL8 3.x has failed when building commit 97eaf2b.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/185/builds/8) and take a look at the build logs.
  4. Check if the failure is related to this commit (97eaf2b) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/185/builds/8

Summary of the results of the build (if available):

Click to see traceback logs
remote: Enumerating objects: 16, done.        
remote: Counting objects:   6% (1/16)        
remote: Counting objects:  12% (2/16)        
remote: Counting objects:  18% (3/16)        
remote: Counting objects:  25% (4/16)        
remote: Counting objects:  31% (5/16)        
remote: Counting objects:  37% (6/16)        
remote: Counting objects:  43% (7/16)        
remote: Counting objects:  50% (8/16)        
remote: Counting objects:  56% (9/16)        
remote: Counting objects:  62% (10/16)        
remote: Counting objects:  68% (11/16)        
remote: Counting objects:  75% (12/16)        
remote: Counting objects:  81% (13/16)        
remote: Counting objects:  87% (14/16)        
remote: Counting objects:  93% (15/16)        
remote: Counting objects: 100% (16/16)        
remote: Counting objects: 100% (16/16), done.        
remote: Compressing objects:  11% (1/9)        
remote: Compressing objects:  22% (2/9)        
remote: Compressing objects:  33% (3/9)        
remote: Compressing objects:  44% (4/9)        
remote: Compressing objects:  55% (5/9)        
remote: Compressing objects:  66% (6/9)        
remote: Compressing objects:  77% (7/9)        
remote: Compressing objects:  88% (8/9)        
remote: Compressing objects: 100% (9/9)        
remote: Compressing objects: 100% (9/9), done.        
remote: Total 9 (delta 6), reused 1 (delta 0), pack-reused 0        
From https://github.com/python/cpython
 * branch                  master     -> FETCH_HEAD
Reset branch 'master'

./configure: line 2382: cannot create temp file for here-document: No space left on device
./configure: line 2394: cannot create temp file for here-document: No space left on device
./configure: line 2429: cannot create temp file for here-document: No space left on device
./configure: line 2591: cannot create temp file for here-document: No space left on device
./configure: line 2595: cannot create temp file for here-document: No space left on device
./configure: line 2599: cannot create temp file for here-document: No space left on device
./configure: line 2603: cannot create temp file for here-document: No space left on device
./configure: line 2607: cannot create temp file for here-document: No space left on device
./configure: line 2611: cannot create temp file for here-document: No space left on device
mkdir: cannot create directory '/tmp/cg136193-27370': No space left on device
mkdir: cannot create directory '/tmp/cg-136193': No space left on device
config.guess: cannot create a temporary directory in /tmp
configure: error: cannot guess build type; you must specify one

make: *** No rule to make target 'distclean'.  Stop.

@miss-islington
Copy link
Contributor

Thanks @wmeehan for the PR, and @corona10 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 30, 2020
* bpo-41524: fix pointer bug in PyOS_mystr{n}icmp

The existing implementations of PyOS_mystrnicmp and PyOS_mystricmp
can increment pointers beyond the end of a string.

This commit fixes those cases by moving the mutation out of the condition.

* 📜🤖 Added by blurb_it.

* Address comments

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 97eaf2b)

Co-authored-by: wmeehan <wmeehan@users.noreply.github.com>
@bedevere-bot
Copy link

GH-22016 is a backport of this pull request to the 3.8 branch.

xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
* bpo-41524: fix pointer bug in PyOS_mystr{n}icmp

The existing implementations of PyOS_mystrnicmp and PyOS_mystricmp
can increment pointers beyond the end of a string.

This commit fixes those cases by moving the mutation out of the condition.

* 📜🤖 Added by blurb_it.

* Address comments

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
tekknolagi pushed a commit to facebookarchive/skybison that referenced this pull request Aug 26, 2021
Summary: Copy changes from python/cpython#21845

Based on Facebook D23081898
artemmukhin added a commit to artemmukhin/cpython that referenced this pull request Mar 6, 2023
artemmukhin added a commit to artemmukhin/cpython that referenced this pull request Mar 6, 2023
artemmukhin added a commit to artemmukhin/cpython that referenced this pull request Mar 6, 2023
artemmukhin added a commit to artemmukhin/cpython that referenced this pull request Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants