If a section name is exactly 8 characters (the maximum section name length),
and the next item in the section header struct contains a non-zero value,
we would append garbage data to the end of the section name string due to the
lack of null-termination. Ensure that we don't construct the section name
with more than sizeof(sect.name) characters.
Details
Details
Diff Detail
Diff Detail
- Build Status
Buildable 15644 Build 15644: arc lint + arc unit
Event Timeline
Comment Actions
Is it possible to test this? Is it possible to make yaml2obj generate a file that would trigger this?
Comment Actions
Just compile something with /Z7 and you'll get a section called .debug$S in the object file, which is exactly 8 characters. Then teach lldb-test to dump an object file's sections.
source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | ||
---|---|---|
511 | This is storing any extra NULL characters in sect_name. Might be better to do: sect_name = std::string(sect.name, strnlen(sect.name, sizeof(sect.name))); |
This is storing any extra NULL characters in sect_name. Might be better to do: