diff options
author | Eugene Tarassov | 2012-11-09 22:30:31 +0000 |
---|---|---|
committer | Eugene Tarassov | 2012-11-09 22:31:02 +0000 |
commit | 45205a367e8622eff6cb272097f3c3bf77030a50 (patch) | |
tree | 5b4a3dfa26062a9e75c3f2c16c21170dc34d0097 /plugins | |
parent | 3f3a38a809fe6829a328862a117409e57a77dae3 (diff) | |
download | org.eclipse.tcf-45205a367e8622eff6cb272097f3c3bf77030a50.tar.gz org.eclipse.tcf-45205a367e8622eff6cb272097f3c3bf77030a50.tar.xz org.eclipse.tcf-45205a367e8622eff6cb272097f3c3bf77030a50.zip |
TCF Debugger: fixed regression: ArrayIndexOutOfBoundsException when debugger reads remote c-string value
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java index 1d470a223..fd3c44c7e 100644 --- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java +++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java @@ -516,14 +516,14 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT } if (size == 0) { // c-string: read until 0 + BigInteger get_addr = addr.add(BigInteger.valueOf(offs)); + final int get_size = 16 - (get_addr.intValue() & 0xf); if (buf == null) buf = new byte[256]; - if (offs >= buf.length) { + if (offs + get_size > buf.length) { byte[] tmp = new byte[buf.length * 2]; System.arraycopy(buf, 0, tmp, 0, buf.length); buf = tmp; } - BigInteger get_addr = addr.add(BigInteger.valueOf(offs)); - final int get_size = 16 - (get_addr.intValue() & 0xf); command = mem_space_data.get(get_addr, 1, buf, offs, get_size, 0, new IMemory.DoneMemory() { public void doneMemory(IToken token, MemoryError error) { if (command != token) return; |