GT-3490 fix reading past EOF in ByteProviders

This commit is contained in:
ghidra1
2020-09-29 15:51:28 -04:00
parent 226e1952cf
commit 4e1b743901
13 changed files with 187 additions and 361 deletions

View File

@@ -76,7 +76,8 @@ public class PrelinkFileSystem extends GFileSystemBase implements GFileSystemPro
@Override
public boolean isValid(TaskMonitor monitor) throws IOException {
try {
return !MachoPrelinkUtils.parsePrelinkXml(provider, monitor).isEmpty();
return MachHeader.isMachHeader(provider) &&
!MachoPrelinkUtils.parsePrelinkXml(provider, monitor).isEmpty();
}
catch (JDOMException e) {
Msg.warn(this, e.getMessage());