Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2017-07-14 16:10:51 +0000
committerNiraj Modi2017-07-17 10:13:00 +0000
commit34821480d44d654541f3b283b235bac2b5233a3c (patch)
tree0da28ddfb3e0cf2a56cdc8399195aee4f95fa9bd
parent401d59744279a7ef0a8b535d2ff46522fafad529 (diff)
downloadeclipse.platform.swt-34821480d44d654541f3b283b235bac2b5233a3c.tar.gz
eclipse.platform.swt-34821480d44d654541f3b283b235bac2b5233a3c.tar.xz
eclipse.platform.swt-34821480d44d654541f3b283b235bac2b5233a3c.zip
Bug 500832 - [Win32] StringIndexOutOfBoundsException below
Table.wmNotifyChild (thrown in String.getChars) Change-Id: I0481635eeaf599fb2be22a0f203724d6bed24ea7 Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index 06489ffb6a..46f8c7cd3a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -7011,7 +7011,7 @@ LRESULT wmNotifyChild (NMHDR hdr, long /*int*/ wParam, long /*int*/ lParam) {
* from drawing the selection when LVS_EX_FULLROWSELECT
* is set.
*/
- int length = Math.min (string.length (), plvfi.cchTextMax - 1);
+ int length = Math.min (string.length (), Math.max (0, plvfi.cchTextMax - 1));
if (!tipRequested && plvfi.iSubItem == 0 && length == 0) {
string = " "; //$NON-NLS-1$
length = 1;

Back to the top