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, Feb 8, 5:32 PM
Unknown Object (File)
Thu, Feb 5, 9:14 PM
Unknown Object (File)
Tue, Feb 3, 7:07 AM
Unknown Object (File)
Tue, Feb 3, 4:08 AM
Unknown Object (File)
Sat, Jan 31, 8:13 PM
Unknown Object (File)
Jan 12 2026, 1:45 PM
Unknown Object (File)
Dec 14 2025, 6:24 AM
Unknown Object (File)
Dec 11 2025, 12:27 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