GT-3344: Fixed exception in PeLoader that occurred when creating a

memory block for the headers when the block size exceeded the file size
(fixes #1266).
This commit is contained in:
Ryan Kurtz
2019-11-21 11:31:58 -05:00
parent ebb336b7f0
commit 23fe661db3
@@ -612,7 +612,7 @@ public class PeLoader extends AbstractPeDebugLoader {
}
// Header block
int virtualSize = getVirtualSize(pe, sections, space);
int virtualSize = (int) Math.min(getVirtualSize(pe, sections, space), fileBytes.getSize());
long addr = optionalHeader.getImageBase();
Address address = space.getAddress(addr);