The following first line of code was causing an
IndexOutOfBoundsException in
org.apache.struts.config.ActionConfigMatcher.convertActionConfig(String
path, ActionConfig orig, Map vars) at line 185, when the variable 'path'
was the empty string:

---
if (path.charAt(0) != '/') {
    path = "/" + path;
}
---

It *is* possible for the 'path' variable to be the empty string, and
indeed ActionConfigMatcher codes defensively for this case elsewhere-
just not here. This bug is present in all versions, including the most
recent, of the ActionConfigMatcher class, as found at:

http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/st
ruts/config/ActionConfigMatcher.java

The attached patch changes the line to:

---
if (path.length() == 0 || path.charAt(0) != '/') {
    path = "/" + path;
}
---


cheers,

Roberto



--------------------------------------------------------------- -
        Visit our Internet site at http://www.reuters.com

Get closer to the financial markets with Reuters Messaging - for more
information and to register, visit http://www.reuters.com/messaging

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be
the views of Reuters Ltd.

--- 
C:\java\jakarta-struts-src-20040104\src\share\org\apache\struts\config\ActionConfigMatcher.java
     Sun Jan 04 13:38:16 2004
+++ 
C:\java\jakarta-struts-src-20040104.rst.01\src\share\org\apache\struts\config\ActionConfigMatcher.java
      Mon Jan 05 09:13:53 2004
@@ -182,7 +182,7 @@
         }
         
         config.setName(convertParam(orig.getName(), vars));
-        if (path.charAt(0) != '/') {
+        if (path.length() == 0 || path.charAt(0) != '/') {
             path = "/" + path;
         }    
         config.setPath(path);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to