From 1e5ceb27dc9848ada0064603b6923d04b89a753d Mon Sep 17 00:00:00 2001 From: David Jencks Date: Fri, 3 Sep 2010 00:55:28 +0000 Subject: [PATCH] bug 324360 validate input on getResource since loop logic obscures subclass input validation. Port from jetty 8 rev 324360 git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2240 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../src/main/java/org/eclipse/jetty/webapp/WebAppContext.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java index 4e50541939e..bc4a3de8802 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java @@ -327,6 +327,9 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL @Override public Resource getResource(String uriInContext) throws MalformedURLException { + if (uriInContext==null || !uriInContext.startsWith(URIUtil.SLASH)) + throw new MalformedURLException(uriInContext); + IOException ioe= null; Resource resource= null; int loop=0;