Summary: | pfctl parser error | ||
---|---|---|---|
Product: | Base System | Reporter: | pr |
Component: | bin | Assignee: | freebsd-pf (Nobody) <pf> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | kp |
Priority: | --- | Keywords: | patch |
Version: | 11.2-STABLE | ||
Hardware: | Any | ||
OS: | Any |
Description
pr
2018-09-12 09:32:28 UTC
Can you test this patch? diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 3b1f0bbea3d..c542bf72f70 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -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); } ; (In reply to Kristof Provost from comment #1) Yes, this helps. Thanks! Pavel A commit references this bug: Author: kp Date: Sat Oct 20 18:11:47 UTC 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 Changes: head/sbin/pfctl/parse.y A commit references this bug: Author: kp Date: Sat Oct 20 18:18:29 UTC 2018 New revision: 339466 URL: https://svnweb.freebsd.org/changeset/base/339466 Log: pfctl tests: Basic test case for PR 231323 PR: 231323 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17508 Changes: head/sbin/pfctl/tests/files/pf1005.in head/sbin/pfctl/tests/files/pf1005.ok head/sbin/pfctl/tests/files/pfctl_test_descr.sh head/sbin/pfctl/tests/pfctl_test.sh A commit references this bug: Author: kp Date: Sun Nov 18 09:47:30 UTC 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 Changes: _U stable/12/ stable/12/sbin/pfctl/parse.y A commit references this bug: Author: kp Date: Sun Nov 18 09:47:40 UTC 2018 New revision: 340550 URL: https://svnweb.freebsd.org/changeset/base/340550 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 Changes: _U stable/11/ stable/11/sbin/pfctl/parse.y A commit references this bug: Author: kp Date: Sun Nov 18 09:48:52 UTC 2018 New revision: 340551 URL: https://svnweb.freebsd.org/changeset/base/340551 Log: MFC r339466: pfctl tests: Basic test case for PR 231323 PR: 231323 Changes: _U stable/12/ stable/12/sbin/pfctl/tests/files/pf1005.in stable/12/sbin/pfctl/tests/files/pf1005.ok stable/12/sbin/pfctl/tests/files/pfctl_test_descr.sh stable/12/sbin/pfctl/tests/pfctl_test.sh |