-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@wmeehan cc @serhiy-storchaka |
* 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>
GH-21978 is a backport of this pull request to the 3.9 branch. |
GH-21979 is a backport of this pull request to the 3.8 branch. |
* 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>
|
* 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>
GH-22016 is a backport of this pull request to the 3.8 branch. |
* 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>
Summary: Copy changes from python/cpython#21845 Based on Facebook D23081898
Including cases fixed in pythonGH-21845
Including cases fixed in pythonGH-21845
Including cases fixed in pythonGH-21845
Including cases fixed in pythonGH-21845
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