From fba1eb48d1e8326cf709aea6d2612465eddc8778 Mon Sep 17 00:00:00 2001 From: Jason Shirk Date: Thu, 2 Jun 2022 21:26:31 -0700 Subject: [PATCH] Remove check on debug directory size The well intentioned check on debug directory size unfortunately results in an error when debug information is embedded in the image. Tools like Digital Mars embed CV debug info in the image instead of creating a PDB, and some older tools embed COFF debug info in the image. --- src/pe/debug.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pe/debug.rs b/src/pe/debug.rs index a2b55e929..b1da12c26 100644 --- a/src/pe/debug.rs +++ b/src/pe/debug.rs @@ -150,8 +150,8 @@ impl<'a> CodeviewPDB70DebugInfo<'a> { // calculate how long the eventual filename will be, which doubles as a check of the record size let filename_length = idd.size_of_data as isize - 24; - if filename_length < 0 || filename_length > 1024 { - // the record is too short or too long to be plausible + if filename_length < 0 { + // the record is too short to be plausible return Err(error::Error::Malformed(format!( "ImageDebugDirectory size of data seems wrong: {:?}", idd.size_of_data