From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 23 03:30:09 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C99616A41F for ; Mon, 23 Jan 2006 03:30:09 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F91843D45 for ; Mon, 23 Jan 2006 03:30:09 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k0N3U9Xp053683 for ; Mon, 23 Jan 2006 03:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k0N3U9O8053681; Mon, 23 Jan 2006 03:30:09 GMT (envelope-from gnats) Date: Mon, 23 Jan 2006 03:30:09 GMT Message-Id: <200601230330.k0N3U9O8053681@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Giorgos Keramidas Cc: Subject: Re: bin/92074: top(1) aborts in redzone X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Giorgos Keramidas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2006 03:30:09 -0000 The following reply was made to PR bin/92074; it has been noted by GNATS. From: Giorgos Keramidas To: bug-followup@FreeBSD.org Cc: Subject: Re: bin/92074: top(1) aborts in redzone Date: Mon, 23 Jan 2006 05:28:17 +0200 Adding to audit trail: % Date: Fri, 20 Jan 2006 21:20:59 +0100 % From: Fredrik Lindberg % Subject: Re: top(1) aborts in redzone % To: Giorgos Keramidas % Cc: freebsd-current@freebsd.org, jasone@freebsd.org, % Steve Kargl % % It's writing past its buffer when a line gets truncated. % Either increase the buffer by one, or decrease the offset on the % places where it is manupulating the buffer. % Both solutions work (I tried them), the easiest one is attached. % % Fredrik Lindberg % % Index: display.c % =================================================================== % RCS file: /home/ncvs/src/contrib/top/display.c,v % retrieving revision 1.9 % diff -u -r1.9 display.c % --- display.c 19 May 2005 13:34:19 -0000 1.9 % +++ display.c 20 Jan 2006 20:18:03 -0000 % @@ -114,7 +114,7 @@ % } % % /* now, allocate space for the screen buffer */ % - screenbuf = (char *)malloc(lines * display_width); % + screenbuf = (char *)malloc(lines * (display_width + 1)); % if (screenbuf == (char *)NULL) % { % /* oops! */