cvs commit: src/sbin/sysctl sysctl.c
Matthew Dillon
dillon at apollo.backplane.com
Thu Jan 13 13:52:55 PST 2005
:joerg 2005/01/11 15:36:39 PST
:
:DragonFly src repository
:
: Modified files:
: sbin/sysctl sysctl.c
: Log:
: 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 at xxxxxxxxxxx>
:
: Revision Changes Path
: 1.8 +22 -15 src/sbin/sysctl/sysctl.c
:
:
:http://www.dragonflybsd.org/cvsweb/src/sbin/sysctl/sysctl.c.diff?r1=1.7&r2=1.8&f=u
Use malloc instead of alloca please. Also, alloca is non-portable
and using it inside a braced substatement is even more non-portable.
-Matt
Matthew Dillon
<dillon at xxxxxxxxxxxxx>
More information about the Commits
mailing list