Bug 59013 - In 8.0.32, WebappClassLoaderBase.filter throws StringIndexOutOfBoundsException for "org"
Summary: In 8.0.32, WebappClassLoaderBase.filter throws StringIndexOutOfBoundsExceptio...
Status: RESOLVED DUPLICATE of bug 58999
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Manager (show other bugs)
Version: 8.0.32
Hardware: Macintosh Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-16 16:12 UTC by Max Tardiveau
Modified: 2016-02-16 16:13 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Tardiveau 2016-02-16 16:12:18 UTC
As of 8.0.32, WebappClassLoaderBase.filter() now looks for "org" in the class name, but if the class name happens to be just "org", it throws a StringIndexOutOfBoundsException at line 2780.

This may seem minor (who's got a class called "org"?) but it's not, because applications that use Rhino will hit this problem very quickly. When loading a class a.b.c.MyClass, Rhino will try to load each package, i.e. a, then a.b, then a.b.c, then finally a.b.c.MyClass. So if you try to load a class that's in a org package, you get the exception.

The fix should be simple: if the class name starts with "org", do *not* assume that it's longer than 3 characters.
Comment 1 Violeta Georgieva 2016-02-16 16:13:47 UTC

*** This bug has been marked as a duplicate of bug 58999 ***