gh-150372: add missing null check on completer_word_break_characters in readline.c#150251
Merged
serhiy-storchaka merged 7 commits intoMay 30, 2026
Conversation
strdup
Member
|
Please create both an issue and a NEWS entry and update the PR title. It does not indicate what the change is about and is a poor commit message. |
strdupstrdup
strdupcompleter_word_break_characters
completer_word_break_characterscompleter_word_break_characters in readline.c
vstinner
reviewed
May 28, 2026
| @@ -0,0 +1,3 @@ | |||
| Fix missing null check on the result of :func:`!strdup` in | |||
| :mod:`readline` module initialization, preventing a potential null pointer | |||
| dereference on memory allocation failure. | |||
Member
There was a problem hiding this comment.
Suggested change
| dereference on memory allocation failure. | |
| :mod:`readline`: Fix missing null check on the result of :func:`!strdup` | |
| in module initialization, preventing a potential null pointer |
Contributor
Author
There was a problem hiding this comment.
I applied the suggestion but I think it resulted in a borked news entry so I fixed it up myself.
Should be good I believe, I'll let you double check.
…150372.9hLqhe.rst Co-authored-by: Victor Stinner <vstinner@python.org>
sergey-miryanov
approved these changes
May 30, 2026
|
Thanks @KowalskiThomas for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-150628 is a backport of this pull request to the 3.15 branch. |
|
GH-150629 is a backport of this pull request to the 3.14 branch. |
|
GH-150630 is a backport of this pull request to the 3.13 branch. |
serhiy-storchaka
pushed a commit
that referenced
this pull request
May 31, 2026
serhiy-storchaka
pushed a commit
that referenced
this pull request
May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR?
This adds a missing null pointer check on the result of an
strdupcall used to populatecompleter_word_break_characters. This matches what the remainder of the files does (so I assume this wasn't on purpose / being optimistic aboutstrdup).readlineis missing a null pointer check onstrdupreturn value #150372