Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Parser uses lazy init so move creation of parser inside the block tha…
Browse files Browse the repository at this point in the history
…t uses the container class loader.

This is part 5 of 7 of the fix for CVE-2014-0119

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1589985 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Apr 25, 2014
1 parent 25251de commit 7d33457
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions java/org/apache/jasper/compiler/TagPluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,6 @@ private void init(ErrorDispatcher err) throws JasperException {

parser = new TagPluginParser(ctxt, blockExternal);

} finally {
if (Constants.IS_SECURITY_ENABLED) {
PrivilegedSetTccl pa = new PrivilegedSetTccl(original);
AccessController.doPrivileged(pa);
} else {
Thread.currentThread().setContextClassLoader(original);
}
}

try {
Enumeration<URL> urls =
ctxt.getClassLoader().getResources(META_INF_JASPER_TAG_PLUGINS_XML);
if (urls != null) {
Expand All @@ -119,6 +109,13 @@ private void init(ErrorDispatcher err) throws JasperException {
}
} catch (IOException | SAXException e) {
throw new JasperException(e);
} finally {
if (Constants.IS_SECURITY_ENABLED) {
PrivilegedSetTccl pa = new PrivilegedSetTccl(original);
AccessController.doPrivileged(pa);
} else {
Thread.currentThread().setContextClassLoader(original);
}
}

Map<String, String> plugins = parser.getPlugins();
Expand Down

0 comments on commit 7d33457

Please sign in to comment.