cvs commit: src/include unistd.h

Marcel Moolenaar marcel at xcllnt.net
Tue Aug 19 14:04:24 PDT 2003


On Tue, Aug 19, 2003 at 01:39:49PM -0700, Garrett Wollman wrote:
> wollman     2003/08/19 13:39:49 PDT
> 
>   FreeBSD src repository
> 
>   Modified files:
>     include              unistd.h 
>   Log:
>   Update gethostname() prototype to match source and standard.

Changing the type of the namelen argument from int to size_t in
at least the implementation of the function breaks the ABI on
64-bit platforms. The problem is that sign-extension is moved
from the callee to the caller and previously compiled code will
not have said sign-extension. Since the namelen argument is used
to specify the size of the name array, we now have a possible
undetected buffer overrun due to garbage in the upper 32-bit).

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel at xcllnt.net


More information about the cvs-src mailing list