Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Aug 2003 14:04:21 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Garrett Wollman <wollman@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/include unistd.h
Message-ID:  <20030819210421.GA28597@athlon.pn.xcllnt.net>
In-Reply-To: <200308192039.h7JKdni9081097@repoman.freebsd.org>
References:  <200308192039.h7JKdni9081097@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@xcllnt.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030819210421.GA28597>