From owner-svn-src-head@FreeBSD.ORG Mon Sep 22 16:13:39 2014 Return-Path: Delivered-To: svn-src-head@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 ESMTPS id 7D928922; Mon, 22 Sep 2014 16:13:39 +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 3E0A3EF6; Mon, 22 Sep 2014 16:13:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8MGDcIL076184; Mon, 22 Sep 2014 16:13:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8MGDcFo076183; Mon, 22 Sep 2014 16:13:38 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201409221613.s8MGDcFo076183@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 22 Sep 2014 16:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271974 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 16:13:39 -0000 Author: cy Date: Mon Sep 22 16:13:38 2014 New Revision: 271974 URL: http://svnweb.freebsd.org/changeset/base/271974 Log: #551 ipf.conf address structure not properly zero filled Approved by: glebius (mentor) Obtained from: ipfilter CVS repo (r1.37), netbsd CVS repo (r1.3) Modified: head/contrib/ipfilter/tools/ipf_y.y Modified: head/contrib/ipfilter/tools/ipf_y.y ============================================================================== --- head/contrib/ipfilter/tools/ipf_y.y Mon Sep 22 16:13:33 2014 (r271973) +++ head/contrib/ipfilter/tools/ipf_y.y Mon Sep 22 16:13:38 2014 (r271974) @@ -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;