Don't write the name of the sysctl to a temporary variable and truncate
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Tue, 11 Jan 2005 23:36:39 +0000 (23:36 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Tue, 11 Jan 2005 23:36:39 +0000 (23:36 +0000)
commitd956758b869fa9429157782f5769b9efa9951304
treeaaf32bad1d047551ff8614b19fda6b0ad08958ca
parent1dde0a48f885373a808be97a39a3b624d28da13b
Don't write the name of the sysctl to a temporary variable and truncate
it on the '=' there. If the argument is actually longer than the buffer,
this would result in a NULL reference. Instead, allocate the necessary
buffer with alloca and copy the name part.

Discovered-by: Suleiman Souhlal <ssouhlal@FreeBSD.org>
sbin/sysctl/sysctl.c