Page MenuHomeFreeBSD

sbin/ipfw: Fix null pointer deference when printing counters
ClosedPublic

Authored by donner on Apr 30 2021, 2:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 26, 7:11 PM
Unknown Object (File)
Sun, Jul 26, 7:09 PM
Unknown Object (File)
Sun, Jul 26, 7:06 PM
Unknown Object (File)
Mon, Jul 20, 2:34 AM
Unknown Object (File)
Sat, Jul 4, 10:18 PM
Unknown Object (File)
Jun 21 2026, 1:52 PM
Unknown Object (File)
May 23 2026, 2:07 AM
Unknown Object (File)
May 23 2026, 2:07 AM

Details

Summary

ipfw -[tT] prints statistics of the last access. If the rule was never
used, the counter might be not exist. This happens unconditionally on
inserting a new rule. Avoid printing statistics in this case.

PR: 255491
Reported by: Haisheng Zhouz
MFC after: 1 week

Test Plan
# ipfw -t add allow tcp from any to any out

should not segfault.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable