HomeFreeBSD

Suppress Clang Static Analyzer warning in dsl_dir_rename_sync()

Description

Suppress Clang Static Analyzer warning in dsl_dir_rename_sync()

Clang's static analyzer reports that if we try to rename a root dataset
in dsl_dir_rename_sync(), we will have a NULL pointer passed to
strlcpy(). This is impossible because dsl_dir_rename_check() will
prevent us from doing this. We add an assertion to silence this warning.

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 5 2023, 3:23 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 8 2023, 9:51 PM
Parents
rG17443e0b2044: Cleanup: Remove constant comparisons reported by CodeQL
Branches
Unknown
Tags
Unknown

Event Timeline

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