From owner-svn-src-stable-10@FreeBSD.ORG Sun Oct 12 16:55:27 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A93A1EC; Sun, 12 Oct 2014 16:55:27 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9523BD3A; Sun, 12 Oct 2014 16:55:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CGtROU053203; Sun, 12 Oct 2014 16:55:27 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CGtR1d053202; Sun, 12 Oct 2014 16:55:27 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121655.s9CGtR1d053202@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 16:55:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272988 - stable/10/contrib/ipfilter/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 16:55:27 -0000 Author: cy Date: Sun Oct 12 16:55:26 2014 New Revision: 272988 URL: https://svnweb.freebsd.org/changeset/base/272988 Log: MFC r271974 ipfilter bug #551 ipf.conf address structure not properly zero filled. Obtained from: ipfilter CVS repo (r1.37), netbsd CVS repo (r1.3) Modified: stable/10/contrib/ipfilter/tools/ipf_y.y Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/tools/ipf_y.y ============================================================================== --- stable/10/contrib/ipfilter/tools/ipf_y.y Sun Oct 12 16:51:02 2014 (r272987) +++ stable/10/contrib/ipfilter/tools/ipf_y.y Sun Oct 12 16:55:26 2014 (r272988) @@ -1020,12 +1020,13 @@ addr: pool '/' YY_NUMBER { pooled = 1; yyexpectaddr = 0; } ; -ipaddr: IPFY_ANY { bzero(&($$), sizeof($$)); +ipaddr: IPFY_ANY { memset(&($$), 0, sizeof($$)); $$.type = FRI_NORMAL; $$.ifpos = -1; yyexpectaddr = 0; } - | hostname { $$.a = $1.adr; + | hostname { memset(&($$), 0, sizeof($$)); + $$.a = $1.adr; $$.f = $1.f; if ($1.f == AF_INET6) fill6bits(128, $$.m.i6); @@ -1038,7 +1039,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof | hostname { yyresetdict(); } maskspace { yysetdict(maskwords); yyexpectaddr = 2; } - ipmask { ntomask($1.f, $5, $$.m.i6); + ipmask { memset(&($$), 0, sizeof($$)); + ntomask($1.f, $5, $$.m.i6); $$.a = $1.adr; $$.a.i6[0] &= $$.m.i6[0]; $$.a.i6[1] &= $$.m.i6[1]; @@ -1060,7 +1062,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof yyresetdict(); yyexpectaddr = 0; } - | '(' YY_STR ')' { $$.type = FRI_DYNAMIC; + | '(' YY_STR ')' { memset(&($$), 0, sizeof($$)); + $$.type = FRI_DYNAMIC; ifpflag = FRI_DYNAMIC; $$.ifpos = addname(&fr, $2); $$.lif = 0; @@ -1068,7 +1071,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof | '(' YY_STR ')' '/' { ifpflag = FRI_DYNAMIC; yysetdict(maskwords); } maskopts - { $$.type = ifpflag; + { memset(&($$), 0, sizeof($$)); + $$.type = ifpflag; $$.ifpos = addname(&fr, $2); $$.lif = 0; if (frc->fr_family == AF_UNSPEC) @@ -1083,7 +1087,8 @@ ipaddr: IPFY_ANY { bzero(&($$), sizeof | '(' YY_STR ':' YY_NUMBER ')' '/' { ifpflag = FRI_DYNAMIC; yysetdict(maskwords); } maskopts - { $$.type = ifpflag; + { memset(&($$), 0, sizeof($$)); + $$.type = ifpflag; $$.ifpos = addname(&fr, $2); $$.lif = $4; if (frc->fr_family == AF_UNSPEC) @@ -1142,30 +1147,35 @@ maskopts: ; hostname: - ipv4 { $$.adr.in4 = $1; + ipv4 { memset(&($$), 0, sizeof($$)); + $$.adr.in4 = $1; if (frc->fr_family == AF_INET6) YYERROR; $$.f = AF_INET; yyexpectaddr = 2; } - | YY_NUMBER { if (frc->fr_family == AF_INET6) + | YY_NUMBER { memset(&($$), 0, sizeof($$)); + if (frc->fr_family == AF_INET6) YYERROR; $$.adr.in4_addr = $1; $$.f = AF_INET; yyexpectaddr = 2; } - | YY_HEX { if (frc->fr_family == AF_INET6) + | YY_HEX { memset(&($$), 0, sizeof($$)); + if (frc->fr_family == AF_INET6) YYERROR; $$.adr.in4_addr = $1; $$.f = AF_INET; yyexpectaddr = 2; } - | YY_STR { if (lookuphost($1, &$$.adr) == 0) + | YY_STR { memset(&($$), 0, sizeof($$)); + if (lookuphost($1, &$$.adr) == 0) $$.f = AF_INET; free($1); yyexpectaddr = 2; } - | YY_IPV6 { if (frc->fr_family == AF_INET) + | YY_IPV6 { memset(&($$), 0, sizeof($$)); + if (frc->fr_family == AF_INET) YYERROR; $$.adr = $1; $$.f = AF_INET6;