Fix potential NULL pointer dereference in lzc_ioctl()
Users are allowed to pass NULL to resultp, but we unconditionally assume that they never do. When an external user does pass NULL to resultp, we dereference a NULL pointer. Clang's static analyzer complained about this. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14008
This commit is contained in:
parent
d05f247aec
commit
d016ca1a92
|
@ -233,7 +233,7 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (zc.zc_nvlist_dst_filled) {
|
if (zc.zc_nvlist_dst_filled && resultp != NULL) {
|
||||||
*resultp = fnvlist_unpack((void *)(uintptr_t)zc.zc_nvlist_dst,
|
*resultp = fnvlist_unpack((void *)(uintptr_t)zc.zc_nvlist_dst,
|
||||||
zc.zc_nvlist_dst_size);
|
zc.zc_nvlist_dst_size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue