HomeFreeBSD

Suppress Clang Static Analyzer warning about SNPRINTF_BLKPTR()

Description

Suppress Clang Static Analyzer warning about SNPRINTF_BLKPTR()

Clang's static analyzer pointed out that if we can pass a -1 array index
to copyname[copies] if there are no valid DVAs. This is an absurd
situation, but it suggests that we are missing an assertion, so we add
it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14575

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Mar 4 2023, 2:15 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 8 2023, 9:51 PM
Parents
rGa4240a8ac787: Suppress Clang Static Analyzer false positive in the AVL tree code.
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG0b831cabc6e5: Suppress Clang Static Analyzer warning about SNPRINTF_BLKPTR() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Mar 8 2023, 9:51 PM