OSDN Git Service

gdb/
authorjkratoch <jkratoch>
Fri, 1 Jan 2010 19:57:42 +0000 (19:57 +0000)
committerjkratoch <jkratoch>
Fri, 1 Jan 2010 19:57:42 +0000 (19:57 +0000)
* cli/cli-script.c (process_next_line): Check P2 overrun.

gdb/ChangeLog
gdb/cli/cli-script.c

index 4d5eaa8..58310db 100644 (file)
@@ -1,3 +1,7 @@
+2010-01-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * cli/cli-script.c (process_next_line): Check P2 overrun.
+
 2009-01-01  Joel Brobecker  <brobecker@adacore.com>
 
        Update the copyright hearder to add year 2010 for most GDB files.
index 4509cfc..dae4d64 100644 (file)
@@ -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.