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);
                }
                ;
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to