]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pf: counter argument to pfr_pool_get() may never be NULL
authorKristof Provost <kp@FreeBSD.org>
Thu, 21 Apr 2022 12:53:05 +0000 (14:53 +0200)
committerKristof Provost <kp@FreeBSD.org>
Wed, 27 Apr 2022 06:46:55 +0000 (08:46 +0200)
commita99ef04e0659db80bcf85074c4d37c029f292fe2
treed246b3ba9fd79dfbccd7993fb32a70ad9c57f62c
parent160e2dbfb48dcb1d92ef6c66bf106ee5e6d03d0a
pf: counter argument to pfr_pool_get() may never be NULL

Coverity points out that if counter was NULL when passed to
pfr_pool_get() we could potentially end up dereferencing it.
Happily all users of the function pass a non-NULL pointer. Enforce this
by assertion and remove the pointless NULL check.

Reported by: Coverity (CID 273309)
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit efc64d02a62f3254ecc0b22fcbcb8f73a079669f)
sys/netpfil/pf/pf_table.c