Skip to content

Commit a697f7b

Browse files
committed
Ensure work dir attribute is made read-only
CVE-2010-3718 git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1022134 13f79535-47bb-0310-9956-ffa450edef68
1 parent 2c4536c commit a697f7b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

java/org/apache/catalina/core/StandardContext.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5562,11 +5562,11 @@ private void postWorkDirectory() {
55625562
dir.mkdirs();
55635563

55645564
// Set the appropriate servlet context attribute
5565-
getServletContext().setAttribute(ServletContext.TEMPDIR, dir);
5566-
if (getServletContext() instanceof ApplicationContext)
5567-
((ApplicationContext) getServletContext()).setAttributeReadOnly
5568-
(ServletContext.TEMPDIR);
5569-
5565+
if (context == null) {
5566+
getServletContext();
5567+
}
5568+
context.setAttribute(ServletContext.TEMPDIR, dir);
5569+
context.setAttributeReadOnly(ServletContext.TEMPDIR);
55705570
}
55715571

55725572

0 commit comments

Comments
 (0)