Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2005-08-05 00:00:27 +0000
committerAlain Magloire2005-08-05 00:00:27 +0000
commit2b859274b022bf12cf6c2343f14bd161ff42ff36 (patch)
treec480bdcda6db8b4c5e1b83e59f4572ac0919a265
parentc41e10d0bcd36ec1352084eb2e37923f69d11b3c (diff)
downloadorg.eclipse.cdt-2b859274b022bf12cf6c2343f14bd161ff42ff36.tar.gz
org.eclipse.cdt-2b859274b022bf12cf6c2343f14bd161ff42ff36.tar.xz
org.eclipse.cdt-2b859274b022bf12cf6c2343f14bd161ff42ff36.zip
StringOutofBound fix
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java
index 7115064fd13..8876549a10c 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/gnu/Conditional.java
@@ -119,6 +119,11 @@ public abstract class Conditional extends Parent implements IConditional {
}
}
+ if (count >= line.length()) {
+ arg1 = arg2 = EMPTY;
+ return;
+ }
+
arg1 = line.substring(1, count);
/* Find the start of the second string. */
@@ -152,6 +157,10 @@ public abstract class Conditional extends Parent implements IConditional {
}
}
}
- arg2 = line.substring(0, count);
+ if (count > line.length()) {
+ arg2 = EMPTY;
+ } else {
+ arg2 = line.substring(0, count);
+ }
}
}

Back to the top