This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Minor off-by-one error in command_line_handler


Andrew Cagney writes:
 > > 2002-03-26  Jason Molenda  (jason-cl@molenda.com)
 > > 
 > > 	* event-top.c (command_line_handler): Don't check penultimate
 > > 	byte in zero-length strings.
 > > 
 > > 
 > Yes, and thanks.
 > 
 > Andrew
 > 
 > 

Wait.  This is fine, but, as the comments indicate, the code was taken
from the function command_line_input in top.c, which has the same bug:

      p1 = rl;
      /* Copy line.  Don't copy null at end.  (Leaves line alone
         if this was just a newline)  */
      while (*p1)
	*p++ = *p1++;

      xfree (rl);		/* Allocated in readline.  */

      if (p == linebuffer || *(p - 1) != '\\')
	break;


Jason, can you sneak in a fix for that too?

Thanks
Elena


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]