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)
Sun, Feb 9, 12:17 AM
Unknown Object (File)
Fri, Feb 7, 11:30 PM
Unknown Object (File)
Wed, Feb 5, 5:24 AM
Unknown Object (File)
Sun, Jan 26, 5:30 PM
Unknown Object (File)
Sat, Jan 25, 2:20 PM
Unknown Object (File)
Thu, Jan 23, 9:24 PM
Unknown Object (File)
Jan 12 2025, 7:15 PM
Unknown Object (File)
Jan 10 2025, 1:45 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