1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 08:46:02 +02:00

2004-07-26 Alain Magloire

Fix for PR 68665
	* utils/org/eclipse/cdt/utils/coff/PE.java
This commit is contained in:
Alain Magloire 2004-07-26 18:08:07 +00:00
parent a32d8676d5
commit 403548698f
2 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2004-07-26 Alain Magloire
Fix for PR 68665
* utils/org/eclipse/cdt/utils/coff/PE.java
2004-07-26 Vladimir Hirsl
HP-UX SOM Binary parser patch

View file

@ -493,11 +493,13 @@ public class PE {
}
} catch (IOException e) {
}
byte[] bytes = new byte[data.length - idx];
System.arraycopy(data, idx, bytes, 0, data.length - idx);
Coff.FileHeader filehdr = new Coff.FileHeader(bytes, true);
if (isValidMachine(filehdr.f_magic)) {
return getAttributes(filehdr);
if (idx < data.length) {
byte[] bytes = new byte[data.length - idx];
System.arraycopy(data, idx, bytes, 0, data.length - idx);
Coff.FileHeader filehdr = new Coff.FileHeader(bytes, true);
if (isValidMachine(filehdr.f_magic)) {
return getAttributes(filehdr);
}
}
throw new IOException(CCorePlugin.getResourceString("Util.exception.notPE")); //$NON-NLS-1$
}