Bug 56253 - StringIndexOutOfBoundsException in AbstractArchiveResourceSet.list() method
Summary: StringIndexOutOfBoundsException in AbstractArchiveResourceSet.list() method
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.x-trunk
Hardware: All All
: P2 major (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-12 23:46 UTC by Larry Isaacs
Modified: 2014-03-13 10:43 UTC (History)
0 users



Attachments
Simple patch to add needed string length check. (798 bytes, patch)
2014-03-12 23:46 UTC, Larry Isaacs
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Larry Isaacs 2014-03-12 23:46:45 UTC
Created attachment 31384 [details]
Simple patch to add needed string length check.

Like in the AbstractArchiveResourceSet.getResource() method, the pathInJar variable can be an empty string in the list() method too.  A length check is needed for list() the same as for getResource().  Marking as major since this is needed for the Eclipse Tomcat "Serve modules without publishing" feature to work with Tomcat 8.

Thanks,
Larry
Comment 1 Mark Thomas 2014-03-13 10:43:45 UTC
Thanks for the report. I added some test cases for this and the other methods that use pathInJar. That found a couple of other issues that I also fixed.

The fix is in 8.0.x for 8.0.4 onwards.