HomeFreeBSD

Fix potential NULL pointer dereference in lzc_ioctl()

Description

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

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Oct 14 2022, 8:33 PM
GitHub <noreply@github.com>Committed on Oct 14 2022, 8:33 PM
Parents
rG4d5aef3ba919: zfs_domount: fix double-disown of dataset / double-free of zfsvfs_t
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG19516b69ee41: Fix potential NULL pointer dereference in lzc_ioctl() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Oct 14 2022, 8:33 PM