From 1fb0b985f21908873494ad5172deb1f31078e388 Mon Sep 17 00:00:00 2001 From: Thomas Kowalski Date: Fri, 22 May 2026 15:34:29 +0200 Subject: [PATCH] fix: missing null check on strdup --- Modules/readline.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/readline.c b/Modules/readline.c index 488332f548e5fe3..a7e8bc2066a1ccc 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -1404,6 +1404,10 @@ setup_readline(readlinestate *mod_state) completer_word_break_characters = strdup(" \t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?"); /* All nonalphanums except '.' */ + + if (!completer_word_break_characters) { + return -1; + } #ifdef WITH_EDITLINE // libedit uses rl_basic_word_break_characters instead of // rl_completer_word_break_characters as complete delimiter