Page MenuHomeFreeBSD

pci: propagate vpd read error
ClosedPublic

Authored by rlibby on Sat, Jul 6, 1:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 12, 12:14 PM
Unknown Object (File)
Tue, Jul 9, 3:03 AM
Unknown Object (File)
Mon, Jul 8, 2:34 AM
Unknown Object (File)
Sun, Jul 7, 12:16 AM
Unknown Object (File)
Sat, Jul 6, 9:38 PM
Unknown Object (File)
Sat, Jul 6, 8:24 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