Libc getnameinfo length requirement

Hiroki Sato hrs at FreeBSD.org
Mon Mar 5 02:11:17 UTC 2018


Christophe Beauval <christophebeauval at hotmail.com> wrote
  in <VI1PR0402MB3711C2331551B00ABF42B674A2C50 at VI1PR0402MB3711.eurprd04.prod.outlook.com>:

ch> Hello
ch>
ch> There is a typo in the comment: RFC 4018 is mentioned, this should be 4038.
ch>
ch> There is also a problem with relying on the sa->sa_len presence and sort
ch> of undoing two earlier patches from 17th April 2005, where according to
ch> the commit comment, sa->sa_len is not required by POSIX:
ch> https://github.com/freebsd/freebsd/commit/90a7ec34ec2cf5e36aeb76ff35c656f880659274#diff-25ee506a989a23ae5d8904e113aa66d7
ch> and
ch> https://github.com/freebsd/freebsd/commit/ba35b6aa7602967dbfeb53dc1e32ba1868bd3e98#diff-25ee506a989a23ae5d8904e113aa66d7
ch> .

 Thank you for the review.  A revised patch to eliminate sa_len
 dependency and fix a typo is attached.  It now accepts sizeof(struct
 sockaddr_storage) at a maximum and rejects only too short length
 depending on sa->sa_family.

-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getnameinfo.c.20180305-1.diff
Type: text/x-patch
Size: 1543 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-standards/attachments/20180305/98fc8c24/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-standards/attachments/20180305/98fc8c24/attachment.sig>


More information about the freebsd-standards mailing list