HomeFreeBSD

nvmecontrol wdc: Don't pass a bogus pointer to free().

Description

nvmecontrol wdc: Don't pass a bogus pointer to free().

wdc_get_dui_log_size allocates a buffer and then advances the
returned pointer. Passing this advanced pointer to free() is UB,
so save the original pointer to pass to free() instead.

Reviewed by: imp
Reported by: GCC 12 -Wfree-nonheap-object
Differential Revision: https://reviews.freebsd.org/D36827

Details

Provenance
jhbAuthored on Oct 3 2022, 11:10 PM
Reviewer
imp
Differential Revision
D36827: nvmecontrol wdc: Don't pass a bogus pointer to free().
Parents
rGd30a1689f5b3: libefivar: Fix a buffer overread.
Branches
Unknown
Tags
Unknown