zfs_get_temporary_prop() should not pass NULL to strcpy()
commit3a7d2a0ce0b7e7a2b005256be54fda00feaf86c0
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Fri, 23 Dec 2022 05:00:38 +0000 (23 00:00 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 6 Feb 2023 19:08:57 +0000 (6 11:08 -0800)
tree19ed6b4650db35c389a6a8f16577d573cdd7d882
parent14872aaa4f909d72c6b5e4105dadcfa13c7d9d66
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
module/os/freebsd/zfs/zfs_vfsops.c
module/os/linux/zfs/zfs_vfsops.c