From owner-svn-src-head@freebsd.org Sat Oct 20 18:11:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61CF3FEF799; Sat, 20 Oct 2018 18:11:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE4B7FCE7; Sat, 20 Oct 2018 18:11:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A7D72186D; Sat, 20 Oct 2018 18:11:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9KIBkXK031406; Sat, 20 Oct 2018 18:11:46 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9KIBkgw031405; Sat, 20 Oct 2018 18:11:46 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201810201811.w9KIBkgw031405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 20 Oct 2018 18:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339464 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 339464 X-SVN-Commit-Repository: base 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.29 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: Sat, 20 Oct 2018 18:11:47 -0000 Author: kp Date: Sat Oct 20 18:11:46 2018 New Revision: 339464 URL: https://svnweb.freebsd.org/changeset/base/339464 Log: pfctl: Dup strings When we set the ifname we have to copy the string, rather than just keep the pointer. PR: 231323 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17507 Modified: head/sbin/pfctl/parse.y Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Sat Oct 20 18:08:43 2018 (r339463) +++ head/sbin/pfctl/parse.y Sat Oct 20 18:11:46 2018 (r339464) @@ -4408,7 +4408,7 @@ route_host : STRING { $$ = calloc(1, sizeof(struct node_host)); if ($$ == NULL) err(1, "route_host: calloc"); - $$->ifname = $1; + $$->ifname = strdup($1); set_ipmask($$, 128); $$->next = NULL; $$->tail = $$; @@ -4418,7 +4418,7 @@ route_host : STRING { $$ = $3; for (n = $3; n != NULL; n = n->next) - n->ifname = $2; + n->ifname = strdup($2); } ;