Page MenuHomeFreeBSD

pci: propagate vpd read error
ClosedPublic

Authored by rlibby on Jul 6 2024, 1:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 10, 3:17 AM
Unknown Object (File)
Sat, Jan 3, 3:55 PM
Unknown Object (File)
Mon, Dec 29, 5:27 AM
Unknown Object (File)
Fri, Dec 19, 4:47 PM
Unknown Object (File)
Dec 11 2025, 8:18 PM
Unknown Object (File)
Dec 7 2025, 9:50 PM
Unknown Object (File)
Dec 1 2025, 2:18 PM
Unknown Object (File)
Nov 28 2025, 2:42 PM
Subscribers

Details

Summary

gcc -Wstringop-overflow diagnosed this. On read error, we would return
-1, but not handle it, causing a zero size malloc of value, and then
we'd unconditionally write value[-1 + 1] = '\0'. This should be
harmless in terms of buffer overflow because we should get a minimum
non-zero size allocation from malloc, but it also effectively swallowed
the error.

Diff Detail

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