Skip to content

Commit 1fb0b98

Browse files
fix: missing null check on strdup
1 parent cf5c8c5 commit 1fb0b98

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Modules/readline.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,10 @@ setup_readline(readlinestate *mod_state)
14041404
completer_word_break_characters =
14051405
strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?");
14061406
/* All nonalphanums except '.' */
1407+
1408+
if (!completer_word_break_characters) {
1409+
return -1;
1410+
}
14071411
#ifdef WITH_EDITLINE
14081412
// libedit uses rl_basic_word_break_characters instead of
14091413
// rl_completer_word_break_characters as complete delimiter

0 commit comments

Comments
 (0)