Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Nov 2018 09:47:30 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r340549 - stable/12/sbin/pfctl
Message-ID:  <201811180947.wAI9lUWN075804@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Sun Nov 18 09:47:30 2018
New Revision: 340549
URL: https://svnweb.freebsd.org/changeset/base/340549

Log:
  MFC r339464:
  
  pfctl: Dup strings
  
  When we set the ifname we have to copy the string, rather than just keep
  the pointer.
  
  PR:		231323

Modified:
  stable/12/sbin/pfctl/parse.y
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/pfctl/parse.y
==============================================================================
--- stable/12/sbin/pfctl/parse.y	Sun Nov 18 09:45:52 2018	(r340548)
+++ stable/12/sbin/pfctl/parse.y	Sun Nov 18 09:47:30 2018	(r340549)
@@ -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);
 		}
 		;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811180947.wAI9lUWN075804>