mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-23 15:24:56 +00:00
Fix invalid base relocation table parsing
This commit is contained in:
@@ -511,7 +511,7 @@ namespace SabreTools.Serialization.Deserializers
|
||||
if (obj.BlockSize % 2 != 0)
|
||||
return obj;
|
||||
if (offset + obj.BlockSize > data.Length)
|
||||
return obj;
|
||||
return null;
|
||||
|
||||
int entryCount = ((int)obj.BlockSize - 8) / 2;
|
||||
obj.TypeOffsetFieldEntries = new BaseRelocationTypeOffsetFieldEntry[entryCount];
|
||||
@@ -539,7 +539,7 @@ namespace SabreTools.Serialization.Deserializers
|
||||
var obj = new List<BaseRelocationBlock>();
|
||||
|
||||
int offset = 0;
|
||||
while (offset < data.Length)
|
||||
while (offset + 8 <= data.Length)
|
||||
{
|
||||
var block = ParseBaseRelocationBlock(data, ref offset);
|
||||
if (block == null)
|
||||
|
||||
Reference in New Issue
Block a user