DragonFly BSD
DragonFly commits List (threaded) for 2005-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sbin/sysctl sysctl.c


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 13 Jan 2005 13:52:37 -0800 (PST)

: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@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@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]