Page MenuHomeFreeBSD

pci: propagate vpd read error
ClosedPublic

Authored by rlibby on Jul 6 2024, 1:19 AM.
Tags
None
Referenced Files
F140059655: D45895.id140671.diff
Fri, Dec 19, 4:47 PM
Unknown Object (File)
Thu, Dec 11, 8:18 PM
Unknown Object (File)
Sun, Dec 7, 9:50 PM
Unknown Object (File)
Mon, Dec 1, 2:18 PM
Unknown Object (File)
Fri, Nov 28, 2:42 PM
Unknown Object (File)
Thu, Nov 27, 3:59 PM
Unknown Object (File)
Nov 16 2025, 5:04 PM
Unknown Object (File)
Nov 12 2025, 10:27 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