Bug 172523

Summary: [patch] rpc.lockd(8): Check value of res->ai_family
Product: Base System Reporter: Erik Cederstrand <erik>
Component: binAssignee: freebsd-bugs mailing list <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Erik Cederstrand 2012-10-09 23:30:06 UTC
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:
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:22 UTC
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