Bug 32647

Summary: StringIndexOutOfBounds in DirectoryIndexGenerator for non-default scope
Product: Slide Reporter: John Rousseau <JRRousseau>
Component: WebDAV ServerAssignee: Slide Developer List <slide-dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: Nightly   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: Patch to fix StringIndexOutOfBounds error

Description John Rousseau 2004-12-11 03:19:55 UTC
I'm seeing the following exception when I browse a directory and the "scope"
init param in web.xml is not the empty string.

java.lang.StringIndexOutOfBoundsException: String index out of range: -10
	at java.lang.String.substring(String.java:1444)
	at java.lang.String.substring(String.java:1411)
	at org.apache.slide.webdav.util.WebdavUtils.getAbsolutePath(WebdavUtils.java:277)
	at org.apache.slide.webdav.util.WebdavUtils.getAbsolutePath(WebdavUtils.java:253)
	at
org.apache.slide.webdav.util.DirectoryIndexGenerator.generate(DirectoryIndexGenerator.java:203)
	at org.apache.slide.webdav.method.GetMethod.displayDirectory(GetMethod.java:142)
	at org.apache.slide.webdav.method.GetMethod.executeRequest(GetMethod.java:238)
	at
org.apache.slide.webdav.method.AbstractWebdavMethod.executeRedirect(AbstractWebdavMethod.java:576)
	at
org.apache.slide.webdav.method.AbstractWebdavMethod.run(AbstractWebdavMethod.java:420)
	at org.apache.slide.webdav.WebdavServlet.service(WebdavServlet.java:151)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

DirectoryIndexGenerator.java:203 calls WebdavUtils.getAbsolutePath with a URI of
"". It should be 'scope'. Trivial patch attached.
Comment 1 John Rousseau 2004-12-11 03:23:45 UTC
Created attachment 13733 [details]
Patch to fix StringIndexOutOfBounds error

7 keystroke fix. How many bugs _could_ you have in a 7 keystroke fix? :-)
Comment 2 James Mason 2004-12-11 05:23:26 UTC
No more than four. I'm sure I read that somewhere... :)

Thanks for the patch.