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
2 changes: 1 addition & 1 deletion SabreTools.Serialization.Readers/PortableExecutable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ public static Data.Models.PortableExecutable.DebugData.Entry ParseDebugDirectory
var table = new List<Data.Models.PortableExecutable.DebugData.Entry>();

int offset = 0;
while (offset < data.Length)
while (offset < data.Length && data.Length - offset >= 28)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at ParseDebugDirectoryEntry, it seems to parse 6 Uint32s and 2 Uint16s, so I assume that you need data to be at least 28 bytes long for this to actually succeed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes sense 👍

{
var entry = ParseDebugDirectoryEntry(data, ref offset);
table.Add(entry);
Expand Down