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:
parent
cdfc350d10
commit
703ec24b6c
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue