From 2a604bd73a26fd8e0315090b0ba8eec8cf605482 Mon Sep 17 00:00:00 2001 From: HeroponRikiBestest <50224630+HeroponRikiBestest@users.noreply.github.com> Date: Thu, 30 Jul 2026 17:44:49 -0700 Subject: [PATCH] Ensure that the data being read is actually large enough to have a debug directory entry parsed from it (#96) --- SabreTools.Serialization.Readers/PortableExecutable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SabreTools.Serialization.Readers/PortableExecutable.cs b/SabreTools.Serialization.Readers/PortableExecutable.cs index c2ea8d8b..b58ddd3b 100644 --- a/SabreTools.Serialization.Readers/PortableExecutable.cs +++ b/SabreTools.Serialization.Readers/PortableExecutable.cs @@ -749,7 +749,7 @@ namespace SabreTools.Serialization.Readers var table = new List(); int offset = 0; - while (offset < data.Length) + while (offset < data.Length && data.Length - offset >= 28) { var entry = ParseDebugDirectoryEntry(data, ref offset); table.Add(entry);