HomeFreeBSD

zfs_get_temporary_prop() should not pass NULL to strcpy()

Description

zfs_get_temporary_prop() should not pass NULL to strcpy()

dsl_dir_activity_in_progress() can call zfs_get_temporary_prop() with
the forth value set to NULL, which will pass NULL to strcpy() when
there is a match

Clang's static analyzer caught this with the help of CodeChecker for
Cross Translation Unit analysis.

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

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Dec 23 2022, 5:00 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Feb 6 2023, 7:08 PM
Parents
rG14872aaa4f90: EIO caused by encryption + recursive gang
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG3a7d2a0ce0b7: zfs_get_temporary_prop() should not pass NULL to strcpy() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Feb 6 2023, 7:08 PM