Bug 42444 - Potential NullPointerException in org.apache.catalina.valves.AccessLogValve
Summary: Potential NullPointerException in org.apache.catalina.valves.AccessLogValve
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.11
Hardware: All other
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-17 08:15 UTC by Nils Hammar
Modified: 2007-05-19 11:31 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nils Hammar 2007-05-17 08:15:53 UTC
In the class AccessLogValve.RequestElement in the method addElement there is an
access of the form: request.getProtocol(), even though the variable request is
known to be 'null' which will cause a NullPointerException.

Patch below:
---

Index:
F:/Workspace/Apache2/tomcat6/java/org/apache/catalina/valves/AccessLogValve.java
===================================================================
---
F:/Workspace/Apache2/tomcat6/java/org/apache/catalina/valves/AccessLogValve.java	(revision
538877)
+++
F:/Workspace/Apache2/tomcat6/java/org/apache/catalina/valves/AccessLogValve.java	(working
copy)
@@ -1035,7 +1035,7 @@
                 buf.append(request.getProtocol());
             } else {
                 buf.append("- - ");
-                buf.append(request.getProtocol());
+                // buf.append(request.getProtocol());
             }
         }
     }
Comment 1 Tim Funk 2007-05-19 11:31:53 UTC
Committed in revision 539787.

thanks!