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)
Mon, May 18, 2:19 AM
Unknown Object (File)
Mon, May 18, 2:13 AM
Unknown Object (File)
Sat, May 16, 3:08 PM
Unknown Object (File)
Sat, May 16, 3:08 PM
Unknown Object (File)
Thu, May 14, 4:57 PM
Unknown Object (File)
Thu, May 14, 4:10 PM
Unknown Object (File)
Wed, May 13, 6:45 PM
Unknown Object (File)
Wed, May 6, 10:56 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