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
This commit is contained in:
parent
d158fa4ade
commit
a2a90d6ee5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339464
@ -4408,7 +4408,7 @@ route_host : STRING {
|
|||||||
$$ = calloc(1, sizeof(struct node_host));
|
$$ = calloc(1, sizeof(struct node_host));
|
||||||
if ($$ == NULL)
|
if ($$ == NULL)
|
||||||
err(1, "route_host: calloc");
|
err(1, "route_host: calloc");
|
||||||
$$->ifname = $1;
|
$$->ifname = strdup($1);
|
||||||
set_ipmask($$, 128);
|
set_ipmask($$, 128);
|
||||||
$$->next = NULL;
|
$$->next = NULL;
|
||||||
$$->tail = $$;
|
$$->tail = $$;
|
||||||
@ -4418,7 +4418,7 @@ route_host : STRING {
|
|||||||
|
|
||||||
$$ = $3;
|
$$ = $3;
|
||||||
for (n = $3; n != NULL; n = n->next)
|
for (n = $3; n != NULL; n = n->next)
|
||||||
n->ifname = $2;
|
n->ifname = strdup($2);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user