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)
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
Unknown Object (File)
Sep 22 2024, 9:32 AM
Unknown Object (File)
Sep 19 2024, 8:44 PM
Unknown Object (File)
Sep 18 2024, 10:25 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