1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Check for outof range offsets.

This commit is contained in:
Alain Magloire 2005-01-12 16:38:36 +00:00
parent cdfc350d10
commit 703ec24b6c

View file

@ -248,6 +248,9 @@ public class MemoryBlock extends CObject implements ICDIMemoryBlock {
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getFlags(int)
*/
public synchronized byte getFlags(int offset) {
if (offset < 0 || offset >= getLength()) {
throw new IndexOutOfBoundsException();
}
if (badOffsets == null) {
badOffsets = getBadOffsets(mem);
}
@ -257,9 +260,8 @@ public class MemoryBlock extends CObject implements ICDIMemoryBlock {
return 0;
}
}
return VALID;
}
return 0;
return VALID;
}
}