Found with Clang Static Analyzer: http://scan.freebsd.your.org/freebsd-head/WORLD/2012-10-07-amd64/report-Ap4YNc.html#EndPath
Similar to the create_service() function, lookup_addresses() should fail if the value of res->ai_family is neither AF_INET of AF_INET6.
The base type for res->ai_family is int, so there is no constraint that the value is with AF_INET or AF_INET6.
Fix: See attached patch. Instead of "break;" in the default switch, fail like create_service() function does.
Patch attached with submission follows:
For bugs matching the following criteria:
Status: In Progress Changed: (is less than) 2014-06-01
Reset to default assignee and clear in-progress tags.
Mail being skipped