Bug 32647 - StringIndexOutOfBounds in DirectoryIndexGenerator for non-default scope
Summary: StringIndexOutOfBounds in DirectoryIndexGenerator for non-default scope
Status: RESOLVED FIXED
Alias: None
Product: Slide
Classification: Unclassified
Component: WebDAV Server (show other bugs)
Version: Nightly
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-11 03:19 UTC by John Rousseau
Modified: 2004-12-10 20:23 UTC (History)
0 users



Attachments
Patch to fix StringIndexOutOfBounds error (671 bytes, patch)
2004-12-11 03:23 UTC, John Rousseau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.