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)
Mon, Nov 10, 2:56 PM
Unknown Object (File)
Tue, Nov 4, 11:24 PM
Unknown Object (File)
Mon, Oct 27, 3:15 AM
Unknown Object (File)
Thu, Oct 23, 7:00 PM
Unknown Object (File)
Thu, Oct 23, 4:54 AM
Unknown Object (File)
Sat, Oct 18, 3:52 AM
Unknown Object (File)
Oct 13 2025, 3:43 PM
Unknown Object (File)
Oct 12 2025, 5:19 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