Cap overlay checks to 16 MiB

This commit is contained in:
Matt Nadareski
2024-12-17 15:50:02 -05:00
parent 261c20e95a
commit 1790d82a6e

View File

@@ -376,8 +376,11 @@ namespace SabreTools.Serialization.Wrappers
return _overlayStrings;
}
// TODO: Revisit the 16 MiB limit
// Cap the check for overlay strings to 16 MiB (arbitrary)
int overlayLength = Math.Min(endOfFile - endOfSectionData, 16 * 1024 * 1024);
// Otherwise, cache and return the strings
int overlayLength = endOfFile - endOfSectionData;
_overlayStrings = ReadStringsFromDataSource(endOfSectionData, overlayLength, charLimit: 3);
return _overlayStrings;
}