From owner-svn-src-all@FreeBSD.ORG Sat Sep 21 14:22:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B0F09485; Sat, 21 Sep 2013 14:22:07 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E9A8214B; Sat, 21 Sep 2013 14:22:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8LEM7dV053001; Sat, 21 Sep 2013 14:22:07 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8LEM73r053000; Sat, 21 Sep 2013 14:22:07 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201309211422.r8LEM73r053000@svn.freebsd.org> From: Cy Schubert Date: Sat, 21 Sep 2013 14:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255761 - head/contrib/ipfilter X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2013 14:22:07 -0000 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 {