HomeFreeBSD

Fix NULL pointer passed to strlcpy from zap_lookup_impl()

Description

Fix NULL pointer passed to strlcpy from zap_lookup_impl()

Clang's static analyzer pointed out that whenever zap_lookup_by_dnode()
is called, we have the following stack where strlcpy() is passed a NULL
pointer for realname from zap_lookup_by_dnode():

strlcpy()
zap_lookup_impl()
zap_lookup_norm_by_dnode()
zap_lookup_by_dnode()

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14044

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Oct 15 2022, 2:55 AM
Tony Hutter <hutter2@llnl.gov>Committed on Dec 1 2022, 8:39 PM
Parents
rGa5f17a94d3ce: fm_fmri_hc_create() must call va_end() before returning
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rGbbec0e60a8e7: Fix NULL pointer passed to strlcpy from zap_lookup_impl() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Dec 1 2022, 8:39 PM