Ensure that the data being read is actually large enough to have a debug directory entry parsed from it (#96)

This commit is contained in:
HeroponRikiBestest
2026-07-30 17:44:49 -07:00
committed by GitHub
parent bcc0a5bd1e
commit 2a604bd73a

View File

@@ -749,7 +749,7 @@ namespace SabreTools.Serialization.Readers
var table = new List<Data.Models.PortableExecutable.DebugData.Entry>();
int offset = 0;
while (offset < data.Length)
while (offset < data.Length && data.Length - offset >= 28)
{
var entry = ParseDebugDirectoryEntry(data, ref offset);
table.Add(entry);