Page MenuHomeFreeBSD

pci: propagate vpd read error
ClosedPublic

Authored by rlibby on Jul 6 2024, 1:19 AM.
Tags
None
Referenced Files
F162943868: D45895.diff
Sat, Jul 18, 1:44 PM
Unknown Object (File)
Mon, Jun 22, 7:43 PM
Unknown Object (File)
Jun 12 2026, 6:50 AM
Unknown Object (File)
May 20 2026, 9:17 AM
Unknown Object (File)
May 13 2026, 6:46 PM
Unknown Object (File)
May 13 2026, 6:46 PM
Unknown Object (File)
May 13 2026, 6:21 PM
Unknown Object (File)
May 13 2026, 5:58 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