]> git.proxmox.com Git - mirror_zfs.git/commit
zfs_get_temporary_prop() should not pass NULL to strcpy()
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Fri, 23 Dec 2022 05:00:38 +0000 (00:00 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 6 Feb 2023 19:08:57 +0000 (11:08 -0800)
commit3a7d2a0ce0b7e7a2b005256be54fda00feaf86c0
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