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)
Thu, Nov 28, 10:54 AM
Unknown Object (File)
Oct 27 2024, 10:20 PM
Unknown Object (File)
Oct 27 2024, 10:19 PM
Unknown Object (File)
Oct 16 2024, 8:42 PM
Unknown Object (File)
Oct 7 2024, 4:25 PM
Unknown Object (File)
Sep 27 2024, 9:50 AM
Unknown Object (File)
Sep 24 2024, 5:15 PM
Unknown Object (File)
Sep 12 2024, 1:49 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