Bug report
Bug description:
In readline.c, a call is made to strdup to populate completer_word_break_characters, but the return value of strdup is never checked before being used. In strdup failed, it will lead to a hard crash.
|
completer_word_break_characters = |
|
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?"); |
|
/* All nonalphanums except '.' */ |
|
#ifdef WITH_EDITLINE |
|
// libedit uses rl_basic_word_break_characters instead of |
|
// rl_completer_word_break_characters as complete delimiter |
|
rl_basic_word_break_characters = completer_word_break_characters; |
|
#else |
|
if (using_libedit_emulation) { |
|
rl_basic_word_break_characters = completer_word_break_characters; |
|
} |
|
#endif |
|
rl_completer_word_break_characters = completer_word_break_characters; |
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
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