Bug 3590 - Arguments with '$' in them cause StringIndexOutOfBoundsException
: Arguments with '$' in them cause StringIndexOutOfBoundsException
Status: RESOLVED FIXED
: GRAM
wsrf managed execution job service
: 4.0.0
: PC Linux
: P1 blocker
: 4.0.1
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2005-07-22 11:01 by
Modified: 2005-07-22 11:28 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2005-07-22 11:01:38
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
        at java.lang.StringBuffer.charAt(StringBuffer.java:283)
        at
org.globus.exec.service.exec.ManagedExecutableJobResource.resolveVariableInString(ManagedExecutableJobResource.java:1253)
        at
org.globus.exec.service.exec.ManagedExecutableJobResource.resolveVariables(ManagedExecutableJobResource.java:1147)
        at
org.globus.exec.service.exec.ManagedExecutableJobResource.postInitialize(ManagedExecutableJobResource.java:224)
        at
org.globus.exec.service.exec.StateMachine.processNoneState(StateMachine.java:691)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.globus.exec.service.exec.StateMachine.processState(StateMachine.java:334)
        at org.globus.exec.service.exec.RunQueue.run(RunQueue.java:159)
------- Comment #1 From 2005-07-22 11:18:29 -------
Here's the diff of a fix:

diff -u -r1.43.2.3 ManagedExecutableJobResource.java
--- ManagedExecutableJobResource.java   5 Jul 2005 23:05:21 -0000      
1.43.2.3+++ ManagedExecutableJobResource.java   22 Jul 2005 16:16:39 -0000
@@ -1218,7 +1218,8 @@
             this.logger.trace("found $ at index "
                              + Integer.toString(dollar_idx));

-            if (buffer.charAt(dollar_idx+1) == '{')
+            if (   (buffer.length() > dollar_idx+4) // at least '${?}'
+                && buffer.charAt(dollar_idx+1) == '{')
             {
                 this.logger.trace("found '{'---looks like a reference");
------- Comment #2 From 2005-07-22 11:28:14 -------
Fix in branch.  Trunk comming shortly.