Page MenuHomeFreeBSD

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

Authored by jhb on Sep 29 2022, 10:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 19, 3:36 AM
Unknown Object (File)
Fri, Jan 17, 11:28 PM
Unknown Object (File)
Dec 14 2024, 2:14 AM
Unknown Object (File)
Oct 9 2024, 12:04 PM
Unknown Object (File)
Oct 4 2024, 3:20 AM
Unknown Object (File)
Oct 4 2024, 3:17 AM
Unknown Object (File)
Oct 4 2024, 1:34 AM
Unknown Object (File)
Sep 30 2024, 1:39 PM
Subscribers

Details

Summary

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.

Reported by: GCC 12 -Wfree-nonheap-object

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable