From owner-cvs-all@FreeBSD.ORG Sun Apr 15 12:07:29 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E5C116A408; Sun, 15 Apr 2007 12:07:29 +0000 (UTC) (envelope-from simon@zaphod.nitro.dk) Received: from mx.nitro.dk (zarniwoop.nitro.dk [83.92.207.38]) by mx1.freebsd.org (Postfix) with ESMTP id BE9E013C46C; Sun, 15 Apr 2007 12:07:28 +0000 (UTC) (envelope-from simon@zaphod.nitro.dk) Received: from zaphod.nitro.dk (unknown [192.168.3.39]) by mx.nitro.dk (Postfix) with ESMTP id 932492D4BB7; Sun, 15 Apr 2007 12:07:27 +0000 (UTC) Received: by zaphod.nitro.dk (Postfix, from userid 3000) id 7AC2811478; Sat, 14 Apr 2007 16:31:53 +0200 (CEST) Date: Sat, 14 Apr 2007 16:31:53 +0200 From: "Simon L. Nielsen" To: Stanislav Sedov Message-ID: <20070414143153.GB1082@zaphod.nitro.dk> References: <200704141016.l3EAGqIs023798@repoman.freebsd.org> <1176546388.54822.11.camel@ikaros.oook.cz> <1176546959.54822.14.camel@ikaros.oook.cz> <20070414154246.89ad2946.stas@FreeBSD.org> <20070414124654.GB1687@zaphod.nitro.dk> <20070414181730.eca262c0.stas@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070414181730.eca262c0.stas@FreeBSD.org> User-Agent: Mutt/1.5.11 Cc: cvs-src@FreeBSD.org, pav@FreeBSD.org, cvs-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src/contrib/top top.X top.c top.h src/usr.bin/top machine.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Apr 2007 12:07:29 -0000 On 2007.04.14 18:17:30 +0400, Stanislav Sedov wrote: > On Sat, 14 Apr 2007 14:46:55 +0200 > "Simon L. Nielsen" mentioned: > > > On 2007.04.14 15:42:46 +0400, Stanislav Sedov wrote: > > > On Sat, 14 Apr 2007 12:35:59 +0200 > > > Pav Lucistnik mentioned: > > > > > > > > Also, is the width cut-off technical problem, or is it fixable? > > > > See http://people.freebsd.org/~pav/top.png for what I mean. > > > > > > > > > > Well, they allocate a static buffer of 128 byte lenght, so the result > > > doesn't fit into it. Also, there's buffer overrun, since sprintf is > > > used, not snprintf. > > > > So, if a user sets a very long proctitle now and some other user runs > > top with the new feature the buffer will overflow? > > Well, not quite right. If you screen is wider then 128 symbols, there > could be an overflow, since the row buffer is 128 bytes length. > > I have not touched any limits, just replaced the string it displays. So > there can be overflow with patch or without it, if both the command > name and screen width is wider then 128. > > Well, anyway i'm going to fix that right now. OK, great. "Buffer overflow" and sprintf just make the red warning lights go off :-). -- Simon L. Nielsen