HomeFreeBSD

sbin/ipfw: Fix null pointer deference when printing counters

Description

sbin/ipfw: Fix null pointer deference when printing counters

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
Reviewed by: ae
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30046

Details

Provenance
donnerAuthored on Apr 30 2021, 2:12 PM
Reviewer
ae
Differential Revision
D30046: sbin/ipfw: Fix null pointer deference when printing counters
Parents
rGf6b6d216cafb: usr.bin/netstat: use roundup2 when rounding up to power of 2.
Branches
Unknown
Tags
Unknown