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)
Fri, Mar 7, 5:14 PM
Unknown Object (File)
Feb 28 2025, 10:08 AM
Unknown Object (File)
Feb 22 2025, 2:14 PM
Unknown Object (File)
Feb 10 2025, 10:58 PM
Unknown Object (File)
Feb 10 2025, 9:57 AM
Unknown Object (File)
Feb 9 2025, 7:01 AM
Unknown Object (File)
Feb 9 2025, 4:22 AM
Unknown Object (File)
Feb 2 2025, 11:58 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