cvs commit: src/contrib/top top.X top.c top.h src/usr.bin/top
machine.c
Stanislav Sedov
stas at FreeBSD.org
Sat Apr 14 14:18:11 UTC 2007
On Sat, 14 Apr 2007 14:46:55 +0200
"Simon L. Nielsen" <simon at FreeBSD.org> mentioned:
> On 2007.04.14 15:42:46 +0400, Stanislav Sedov wrote:
> > On Sat, 14 Apr 2007 12:35:59 +0200
> > Pav Lucistnik <pav at FreeBSD.org> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20070414/12340ef4/attachment.pgp
More information about the cvs-src
mailing list