tech-net archive

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

Re: getnameinfo extra len checking

On Mon, 21 Jun 2010 14:23:35 -0400 (EDT)
der Mouse <mouse%Rodents-Montreal.ORG@localhost> wrote:

> really think it should be wider than u_char; as it stands, there is no
> way to set sa_len correctly if the address is longer than 255 bytes,
> which AF_LOCAL may well be.  Unfortunately that runs smack into ABI
> combatability issues.)

The sockaddr_un structure's sun_path field is defined with a fixed size
of 104 bytes, however.  It's true that a path could exceed it, but
fortunately it's common practice to store AF_LOCAL socket files at
locations such as /var/run/ and /tmp/ which are short...

As for the getnameinfo(3) sa_len check, I was also bitten by it when
porting code over from Linux, and had to check the source to find out
the reason of the failure.  However it was easy enough to fix that I
have no strong opinion about removing the sa_len check.

Home | Main Index | Thread Index | Old Index