Date: Mon, 23 Jan 2006 03:30:09 GMT From: Giorgos Keramidas <keramida@freebsd.org> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/92074: top(1) aborts in redzone Message-ID: <200601230330.k0N3U9O8053681@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/92074; it has been noted by GNATS. From: Giorgos Keramidas <keramida@freebsd.org> 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 <fli+freebsd-current@shapeshifter.se> % Subject: Re: top(1) aborts in redzone % To: Giorgos Keramidas <keramida@ceid.upatras.gr> % Cc: freebsd-current@freebsd.org, jasone@freebsd.org, % Steve Kargl <sgk@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! */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601230330.k0N3U9O8053681>