svn commit: r255761 - head/contrib/ipfilter
Cy Schubert
cy at FreeBSD.org
Sat Sep 21 14:22:07 UTC 2013
Author: cy
Date: Sat Sep 21 14:22:07 2013
New Revision: 255761
URL: http://svnweb.freebsd.org/changeset/base/255761
Log:
Check return code from inet_pton.
Discovered by: Coverity.
Approved by: glebius (mentor)
Approved by: re (blanket)
Modified:
head/contrib/ipfilter/ip_fil.c
Modified: head/contrib/ipfilter/ip_fil.c
==============================================================================
--- head/contrib/ipfilter/ip_fil.c Sat Sep 21 11:10:09 2013 (r255760)
+++ head/contrib/ipfilter/ip_fil.c Sat Sep 21 14:22:07 2013 (r255761)
@@ -228,7 +228,19 @@ ipf_setifpaddr(ifp, addr)
sin6 = (struct sockaddr_in6 *)&ifa->ifa_addr;
sin6->sin6_family = AF_INET6;
- inet_pton(AF_INET6, addr, &sin6->sin6_addr);
+ /* Abort if bad address. */
+ switch (inet_pton(AF_INET6, addr, &sin6->sin6_addr))
+ {
+ case 1:
+ break;
+ case -1:
+ perror("inet_pton");
+ abort();
+ break;
+ default:
+ abort();
+ break;
+ }
} else
#endif
{
More information about the svn-src-all
mailing list