svn commit: trunk/busybox/libbb

Vladimir N. Oleynik dzo at simtreas.ru
Mon Feb 20 10:45:21 UTC 2006


vapier at busybox.net wrote:
> Author: vapier
> Date: 2006-02-19 15:03:31 -0800 (Sun, 19 Feb 2006)
> New Revision: 14135
> 
> Log:
> rfelker writes in Bug 742: make sure string is null terminated after calling gethostname

http://www.unix.org/single_unix_specification/

The gethostname() function shall return the standard host name for the current 
machine. The namelen argument shall specify the size of the array pointed to by 
the name argument. The returned name shall be null-terminated, except that if 
namelen is an insufficient length to hold the host name, then the returned name 
shall be truncated and it is unspecified whether the returned name is 
null-terminated.

 From me:

If gethostname do not set \0 we can usage this function absolutelly,
we do not know lenght!


See 14144 svn revision.

--w
vodz



More information about the busybox mailing list