1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-17 14:05:23 +02:00

2004-07-26 Alain Magloire

Fix for PR 70842

	* utils/org/eclipse/cdt/utils/coff/PE.java
This commit is contained in:
Alain Magloire 2004-07-26 18:16:44 +00:00
parent 4609dbd51b
commit cabc0f2aeb
2 changed files with 13 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2004-07-26 Alain Magloire
Fix for PR 70842
* utils/org/eclipse/cdt/utils/coff/PE.java
2004-07-26 Vladimir Hirsl
Tracking PR 70820, SOM Binary parser.

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$
}