From owner-cvs-all@FreeBSD.ORG Sat Apr 14 14:18:11 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 A19C716A402; Sat, 14 Apr 2007 14:18:11 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from com1.ht-systems.ru (com1.ht-systems.ru [83.97.104.204]) by mx1.freebsd.org (Postfix) with ESMTP id 1F14113C46C; Sat, 14 Apr 2007 14:18:11 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from [83.97.105.114] (helo=phonon.SpringDaemons.com ident=postfix) by com1.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1Hcj4q-0008Vj-Vx; Sat, 14 Apr 2007 18:18:09 +0400 Received: from localhost (localhost [127.0.0.1]) by phonon.SpringDaemons.com (Postfix) with SMTP id E6DBC11497; Sat, 14 Apr 2007 18:17:30 +0400 (MSD) Date: Sat, 14 Apr 2007 18:17:30 +0400 From: Stanislav Sedov To: "Simon L. Nielsen" Message-Id: <20070414181730.eca262c0.stas@FreeBSD.org> In-Reply-To: <20070414124654.GB1687@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> Organization: The FreeBSD Project X-Mailer: carrier-pigeon X-Voice: +7 916 849 20 23 X-XMPP: ssedov@jabber.ru X-ICQ: 208105021 X-Yahoo: stanislav_sedov X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-University: MEPhI Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Sat__14_Apr_2007_18_17_30_+0400_JQ6psQbLV46yZVHJ" X-Spam-Flag: SKIP 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: Sat, 14 Apr 2007 14:18:11 -0000 --Signature=_Sat__14_Apr_2007_18_17_30_+0400_JQ6psQbLV46yZVHJ Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit 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. -- Stanislav Sedov ST4096-RIPE --Signature=_Sat__14_Apr_2007_18_17_30_+0400_JQ6psQbLV46yZVHJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFGIOJ6K/VZk+smlYERAg9EAJ4+T4qRlGvcUVv8352AzyzSKXdwXACfcUUY baXyjthbdINms/fgeIuCjD4= =+3/J -----END PGP SIGNATURE----- --Signature=_Sat__14_Apr_2007_18_17_30_+0400_JQ6psQbLV46yZVHJ--