From 1488cd1ff40d0dd8651c7b3c75c76af8e2e62fcc Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 19 Aug 2026 13:30:34 +0200 Subject: [PATCH 1/3] fix(win): accept minimal PDB70 CodeView records Validate the serialized record length instead of the padded C++ struct size so records with an empty PDB filename are accepted. --- snapshot/win/pe_image_reader.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snapshot/win/pe_image_reader.cc b/snapshot/win/pe_image_reader.cc index 5ca53f2f2..52f134dce 100644 --- a/snapshot/win/pe_image_reader.cc +++ b/snapshot/win/pe_image_reader.cc @@ -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) { LOG(WARNING) << "CodeView debug entry of unexpected size in " << module_subrange_reader_.name(); continue; From 8b6a5ac82e246618d82b2989a36d444ce5959e27 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 19 Aug 2026 14:24:22 +0200 Subject: [PATCH 2/3] fix(win): validate CodeView PDB name terminator Reject malformed PDB70 records without a trailing NUL before constructing a string from the filename field. --- snapshot/win/pe_image_reader.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/snapshot/win/pe_image_reader.cc b/snapshot/win/pe_image_reader.cc index 52f134dce..336feffe7 100644 --- a/snapshot/win/pe_image_reader.cc +++ b/snapshot/win/pe_image_reader.cc @@ -201,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(); + return false; + } + CodeViewRecordPDB70* codeview = reinterpret_cast(data.data()); *uuid = codeview->uuid; From bfe80ce620545c956379b990e319ebef19eb0e52 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 19 Aug 2026 14:45:27 +0200 Subject: [PATCH 3/3] continue --- snapshot/win/pe_image_reader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapshot/win/pe_image_reader.cc b/snapshot/win/pe_image_reader.cc index 336feffe7..35c9afe16 100644 --- a/snapshot/win/pe_image_reader.cc +++ b/snapshot/win/pe_image_reader.cc @@ -204,7 +204,7 @@ bool PEImageReader::DebugDirectoryInformation(UUID* uuid, if (data[data.size() - 1] != '\0') { LOG(WARNING) << "CodeView debug entry missing NUL-terminator in " << module_subrange_reader_.name(); - return false; + continue; } CodeViewRecordPDB70* codeview =