Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion snapshot/win/pe_image_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ bool PEImageReader::DebugDirectoryInformation(UUID* uuid,
continue;

if (debug_directory.AddressOfRawData) {
if (debug_directory.SizeOfData < sizeof(CodeViewRecordPDB70)) {
if (debug_directory.SizeOfData <
offsetof(CodeViewRecordPDB70, pdb_name) + 1) {
Comment thread
sentry[bot] marked this conversation as resolved.
LOG(WARNING) << "CodeView debug entry of unexpected size in "
<< module_subrange_reader_.name();
continue;
Expand All @@ -200,6 +201,12 @@ bool PEImageReader::DebugDirectoryInformation(UUID* uuid,
continue;
}

if (data[data.size() - 1] != '\0') {
LOG(WARNING) << "CodeView debug entry missing NUL-terminator in "
<< module_subrange_reader_.name();
continue;
}
Comment thread
cursor[bot] marked this conversation as resolved.
Comment thread
sentry[bot] marked this conversation as resolved.

CodeViewRecordPDB70* codeview =
reinterpret_cast<CodeViewRecordPDB70*>(data.data());
*uuid = codeview->uuid;
Expand Down
Loading