From be66db074f9a3fd3857a4d81e9b41b0fa98b07a3 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 1 Jan 2010 10:57:43 +0000 Subject: [PATCH] gdb/ * cli/cli-script.c (process_next_line): Check P2 overrun. --- gdb/ChangeLog | 4 ++++ gdb/cli/cli-script.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4d5eaa8..58310db 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2010-01-01 Jan Kratochvil + + * cli/cli-script.c (process_next_line): Check P2 overrun. + 2009-01-01 Joel Brobecker Update the copyright hearder to add year 2010 for most GDB files. diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 4509cfc..dae4d64 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -893,7 +893,7 @@ process_next_line (char *p, struct command_line **command, int parse_commands) p2 = p; /* Strip leading whitespace. */ - while (*p2 == ' ' || *p2 == '\t') + while (p2 != p1 && (*p2 == ' ' || *p2 == '\t')) p2++; /* 'end' is always recognized, regardless of parse_commands value. -- 2.7.4