From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3159 invoked by alias); 27 Mar 2002 18:11:22 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 3087 invoked from network); 27 Mar 2002 18:11:19 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 27 Mar 2002 18:11:19 -0000 Received: from localhost.redhat.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA15503; Wed, 27 Mar 2002 10:11:12 -0800 (PST) Received: by localhost.redhat.com (Postfix, from userid 469) id 1164E11429; Wed, 27 Mar 2002 13:10:46 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15522.2853.891361.517767@localhost.redhat.com> Date: Wed, 27 Mar 2002 10:11:00 -0000 To: Andrew Cagney Cc: Jason Molenda , gdb-patches@sources.redhat.com Subject: Re: Minor off-by-one error in command_line_handler In-Reply-To: <3CA1F421.6010009@cygnus.com> References: <20020327000106.A24311@molenda.com> <3CA1F421.6010009@cygnus.com> X-SW-Source: 2002-03/txt/msg00544.txt.bz2 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