]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use the correct size when allocating the cmdbuf string.
authorrpaulo <rpaulo@FreeBSD.org>
Mon, 19 Nov 2012 08:03:40 +0000 (08:03 +0000)
committerrpaulo <rpaulo@FreeBSD.org>
Mon, 19 Nov 2012 08:03:40 +0000 (08:03 +0000)
commitd9a7cd2ca032129e1d49a7bc2ec40bcd984c23f4
tree9fcf46018e8ca0dac85891389ce8fe21b4f308de
parent05b63755364750535dad838ddfce8b9e2bb7fb80
Use the correct size when allocating the cmdbuf string.

cmdlengthdelta is the size of the header and we were using it to
allocate a buffer to store the command line. This would mean that
the cmdbuf could be too short. In practice this was never noticed unless
you usually run top -a. On a stock FreeBSD system you can see the
problem by running sendmail and then running top -a on a big terminal
window. In practice this doubles to size available to cmdbuf since the
header is around 65-68 bytes.

Reviewed by: adrian
usr.bin/top/machine.c