diff options
author | Sarika Sinha | 2018-09-11 05:49:35 +0000 |
---|---|---|
committer | Sarika Sinha | 2018-09-18 08:44:23 +0000 |
commit | c3c5ee9f803eeffbba3226b91d7e481cef8a7712 (patch) | |
tree | 9d850b2f0d6a27fbfaa20dbaf126c6e37a4008be | |
parent | a2f3feaa800d097b5f41348d3ff3458d07d75fdc (diff) | |
download | eclipse.platform.debug-c3c5ee9f803eeffbba3226b91d7e481cef8a7712.tar.gz eclipse.platform.debug-c3c5ee9f803eeffbba3226b91d7e481cef8a7712.tar.xz eclipse.platform.debug-c3c5ee9f803eeffbba3226b91d7e481cef8a7712.zip |
Bug 453407 - [platform] SIOOBE in IOConsolePartition.insertY20180919-2200I20180925-1800I20180924-1800I20180923-1800I20180922-1800I20180922-0245I20180922-0005I20180921-1800I20180920-1800I20180920-0630I20180920-0430I20180919-1800I20180918-2005I20180918-1800
Change-Id: I12e9490497da6a81febbe7c820870ed564ce22de
-rw-r--r-- | org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java index f9675bf2c..6c0d07cc6 100644 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java +++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java @@ -75,6 +75,11 @@ public class IOConsolePartition implements ITypedRegion { * @param offset the offset in the partition */ public void insert(String s, int insertOffset) { + if (insertOffset < 0) { + insertOffset = 0; + } else if (insertOffset > buffer.length()) { + insertOffset = buffer.length(); + } buffer.insert(insertOffset, s); length += s.length(); } |