Avoid passing an uninitialized index to dsl_prop_known_index

Reported-by: KMSAN
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Akash B <akash-b@hpe.com>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Sponsored-by: The FreeBSD Foundation
Closes #14397
This commit is contained in:
Mark Johnston 2023-01-15 17:05:19 -05:00 committed by Brian Behlendorf
parent c6dab6dd39
commit 7c30100c00
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ dsl_prop_get_dd(dsl_dir_t *dd, const char *propname,
/* Check for a iuv value. */
err = zap_lookup(mos, dsl_dir_phys(dd)->dd_props_zapobj,
iuvstr, intsz, numints, buf);
if (dsl_prop_known_index(zfs_name_to_prop(propname),
if (err == 0 && dsl_prop_known_index(zfs_name_to_prop(propname),
*(uint64_t *)buf) != 1)
err = ENOENT;
if (err != ENOENT) {