Fix 47080: NPE in RealmBase.findSecurityConstraints when uri is null
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 1 May 2009 20:12:09 +0000 (20:12 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 1 May 2009 20:12:09 +0000 (20:12 +0000)
https://issues.apache.org/bugzilla/show_bug.cgi?id=47080

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@770809 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/realm/RealmBase.java

index 78797b4..c5de0b1 100644 (file)
@@ -471,6 +471,11 @@ public abstract class RealmBase
 
         // Check each defined security constraint
         String uri = request.getRequestPathMB().toString();
+        // Bug47080 - in rare cases this may be null
+        // Mapper treats as '/' do the same to prevent NPE
+        if (uri == null) {
+            uri = "/";
+        }
         
         String method = request.getMethod();
         int i;