Re: oaf gethostby* bug



On Wed, 13 Sep 2000, Dan Winship wrote:

> oaf_hostname_get assumes it can pass the result of gethostbyname as an
> argument to gethostbyaddr, which is not safe, since they might be
> using the same static buffer. Mmmm... static data.

Nice spotting.

Assuming AF_INET etc. is probably broken. For example, this thing is not
going to work for IPv6-only hosts, and if having a different FQDN for
different networking protocols is legal, the existence of
oaf_hostname_get() at all would be a problem. This is not all your fault,
just something I noticed.

Should switch to using getaddrinfo() and getnameinfo() in any case, to
handle IPv6 etc.

-- Elliot
DEAR IRS, Please cancel my subscription.










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