bin/92074: top(1) aborts in redzone

Giorgos Keramidas keramida at freebsd.org
Sun Jan 22 19:30:09 PST 2006


The following reply was made to PR bin/92074; it has been noted by GNATS.

From: Giorgos Keramidas <keramida at freebsd.org>
To: bug-followup at 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 <fli+freebsd-current at shapeshifter.se>
 % Subject: Re: top(1) aborts in redzone
 % To: Giorgos Keramidas <keramida at ceid.upatras.gr>
 % Cc: freebsd-current at freebsd.org, jasone at freebsd.org,
 %         Steve Kargl <sgk at troutmask.apl.washington.edu>
 %
 % 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! */
 


More information about the freebsd-bugs mailing list