HomeFreeBSD

Fix possible NULL pointer dereference in dbuf_verify()

Description

Fix possible NULL pointer dereference in dbuf_verify()

Coverity reported a dereference after a NULL check in dbuf_verify(). If
dn is NULL, we can just assume that !dn->dn_free_txg, so we change
!dn->dn_free_txg to (dn == NULL || !dn->dn_free_txg).

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reported-by: Coverity (CID-992298)
Closes #14619

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Mar 14 2023, 10:00 PM
GitHub <noreply@github.com>Committed on Mar 14 2023, 10:00 PM
Parents
rG3a03c9638111: Replace dead opensolaris.org license links
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG3cb293a6f803: Fix possible NULL pointer dereference in dbuf_verify() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Mar 14 2023, 10:00 PM