aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-08-15 18:37:00 -0600
committerTom Tromey <tom@tromey.com>2018-08-17 16:37:39 -0600
commit12582533306990c9406aedd960fa411c317a67de (patch)
tree74005391dc703c6ff07974487a81ce2507ca8c55 /gdb/cli
parentbfb1e8c15a6b7d02cd0b9a124d01722a07ebf09a (diff)
downloadgdb-12582533306990c9406aedd960fa411c317a67de.zip
gdb-12582533306990c9406aedd960fa411c317a67de.tar.gz
gdb-12582533306990c9406aedd960fa411c317a67de.tar.bz2
Fix use-after-free in number_or_range_parser
-fsanitize=address showed a use-after-free in number_or_range_parser. The cause was that handle_line_of_input could stash the input into "saved_command_line", and then this could be freed by reentrant calls. This fixes the bug by preventing commands that are read by "commands" from being eligible for repeating. gdb/ChangeLog 2018-08-17 Tom Tromey <tom@tromey.com> * cli/cli-script.c (read_next_line): Pass 0 as repeat argument to command_line_input.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-script.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 6f31a40..d03b3bc 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -903,7 +903,7 @@ read_next_line (void)
else
prompt_ptr = NULL;
- return command_line_input (prompt_ptr, from_tty, "commands");
+ return command_line_input (prompt_ptr, 0, "commands");
}
/* Return true if CMD's name is NAME. */