mirror of
https://github.com/opnsense/src.git
synced 2026-02-04 03:00:53 -06:00
pfctl: fix crash on "pfctl -a '*' -vvsr"
When printing a nat anchor we don't have rule information, or rule counters. Do not attempt to print them. The information is nonsensical anyway, and this can cause a crash converting the timestamp to a string, as years in the very distant future use more digits, and we exceed the 30 byte buffer allocated for this. MFC after: 2 weeks Sponsored by: Orange Business Services (cherry picked from commit 168d873ae41fd8bd40555322a79c9f215cb4cb9c)
This commit is contained in:
parent
52f8e7b2ef
commit
ec7fc9e700
@ -1452,7 +1452,6 @@ pfctl_show_nat(int dev, const char *path, int opts, char *anchorname, int depth,
|
||||
}
|
||||
mnr = prs.nr;
|
||||
|
||||
pfctl_print_rule_counters(&rule, opts);
|
||||
for (nr = 0; nr < mnr; ++nr) {
|
||||
prs.nr = nr;
|
||||
if (ioctl(dev, DIOCGETRULESET, &prs))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user