-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
readline is missing a null pointer check on strdup return value #150372
Copy link
Copy link
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Fields
Give feedbackNo fields configured for issues without a type.
Bug report
Bug description:
In
readline.c, a call is made tostrdupto populatecompleter_word_break_characters, but the return value ofstrdupis never checked before being used. Instrdupfailed, it will lead to a hard crash.cpython/Modules/readline.c
Lines 1404 to 1416 in 1d28f9a
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
completer_word_break_charactersinreadline.c#150251