aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.sbin/isdn
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2026-02-03 12:17:08 +0000
committerKristof Provost <kp@FreeBSD.org>2026-02-03 22:51:28 +0000
commitfe9e4eb6f38ae004efb576bf44aded08852f9e6b (patch)
tree81cdcd20ac2316baf294bd62e26180d955937aa0 /gnu/usr.sbin/isdn
parent895e1c6567d9561c86f8d20b47e924911bce989e (diff)
pf: fix use of uninitialised variableHEADmain
In pf_match_rule() we attempt to append matching rules to the end of 'match_rules'. We want to preserve the order to make the multiple pflog entries easier to understand. So we keep track of the last added rule item in 'rt'. However, that assumed that 'match_rules' was only ever added to in that one call to pf_match_rules(). This isn't always the case, for example if we have match rules in different anchors. In that case we'd end up using the uninitialised 'rt' variable in the SLIST_INSERT_AFTER call. Instead track the match rules and the last matching rule (to enable easy appending) in the struct pf_test_ctx. This also allows us to reduce the number of arguments for some functions, because we passed a ctx to most functions that needed 'match_rules'. While here also make pf_match_rules() static, because it's only ever used in pf.c Add a test case to exercise the relevant code path. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate")
Diffstat (limited to 'gnu/usr.sbin/isdn')
0 files changed, 0 insertions, 0 deletions