HomeFreeBSD

Suppress static analyzer warning in sa_attr_iter()

Description

Suppress static analyzer warning in sa_attr_iter()

Clang's static analyzer points out that when IS_SA_BONUSTYPE(type) is
true and .sa_length is 0 for an attribute, we have a NULL pointer
dereference. We suppress this with an IMPLY() statement.

This was also identified by Coverity.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reported-by: Coverity (CID-1017954)
Closes #14470

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Feb 7 2023, 8:02 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 1 2023, 1:31 AM
Parents
rG4d9bb5514c5a: Suppress static analyzer warnings in zio_checksum_error_impl()
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG7fc48f8378c6: Suppress static analyzer warning in sa_attr_iter() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Mar 1 2023, 1:31 AM