mirror of
https://github.com/TheOfficialFloW/bd-jb
synced 2024-11-22 00:42:21 -05:00
Check for negative offsets.
This commit is contained in:
parent
560014c17d
commit
304686cfc0
@ -142,11 +142,11 @@ public final class JIT {
|
||||
RandomAccessFile file = new RandomAccessFile(path, "r");
|
||||
|
||||
if ((dataSectionOffset & (PAGE_SIZE - 1)) != 0) {
|
||||
throw new IllegalArgumentException("Ddata section offset is not page aligned.");
|
||||
throw new IllegalArgumentException("Unaligned data section offset.");
|
||||
}
|
||||
|
||||
if (dataSectionOffset > file.length()) {
|
||||
throw new IllegalArgumentException("Data section offset is too big.");
|
||||
if (dataSectionOffset < 0 || dataSectionOffset > file.length()) {
|
||||
throw new IllegalArgumentException("Invalid data section offset.");
|
||||
}
|
||||
|
||||
// TODO: Currently we just use maximum size so that the address is predictable.
|
||||
|
Loading…
Reference in New Issue
Block a user