]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix theoretical use of uninitialized values
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Sat, 15 Oct 2022 22:27:03 +0000 (18:27 -0400)
committerTony Hutter <hutter2@llnl.gov>
Thu, 1 Dec 2022 20:39:42 +0000 (12:39 -0800)
commit4c59fde1f5953b86a68bb71579b3184a93f1c9f3
tree0879fbfaa46396bf7d2e3d7385c0e9721956717a
parent3830858c5cb4d209b1a05e6a3dde6b77cb88f2b3
Fix theoretical use of uninitialized values

Clang's static analyzer complains about this.

In get_configs(), if we have an invalid configuration that has no top
level vdevs, we can read a couple of uninitialized variables. Aborting
upon seeing this would break the userland tools for healthy pools, so we
instead initialize the two variables to 0 to allow the userland tools to
continue functioning for the pools with valid configurations.

In zfs_do_wait(), if no wait activities are enabled, we read an
uninitialized error variable.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14043
cmd/zfs/zfs_main.c
lib/libzutil/zutil_import.c