tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r831774 - /tomcat/trunk/java/org/apache/catalina/connector/Response.java
Date Sun, 01 Nov 2009 22:53:29 GMT
Author: markt
Date: Sun Nov  1 22:53:29 2009
New Revision: 831774

URL: http://svn.apache.org/viewvc?rev=831774&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47451
Don't trigger an NPE if headers with null or zero length name or set or if a null value is
specified. Silently ignore any such calls in the same way the calls are ignored if the response
has already been committed.

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/Response.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=831774&r1=831773&r2=831774&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Sun Nov  1 22:53:29 2009
@@ -1009,6 +1009,10 @@
      */
     public void addDateHeader(String name, long value) {
 
+        if (name == null || name.length() == 0) {
+            return;
+        }
+
         if (isCommitted())
             return;
 
@@ -1036,6 +1040,10 @@
      */
     public void addHeader(String name, String value) {
 
+        if (name == null || name.length() == 0 || value == null) {
+            return;
+        }
+
         if (isCommitted())
             return;
 
@@ -1056,6 +1064,10 @@
      */
     public void addIntHeader(String name, int value) {
 
+        if (name == null || name.length() == 0) {
+            return;
+        }
+
         if (isCommitted())
             return;
 
@@ -1281,6 +1293,10 @@
      */
     public void setDateHeader(String name, long value) {
 
+        if (name == null || name.length() == 0) {
+            return;
+        }
+
         if (isCommitted())
             return;
 
@@ -1308,6 +1324,10 @@
      */
     public void setHeader(String name, String value) {
 
+        if (name == null || name.length() == 0 || value == null) {
+            return;
+        }
+
         if (isCommitted())
             return;
 
@@ -1328,6 +1348,10 @@
      */
     public void setIntHeader(String name, int value) {
 
+        if (name == null || name.length() == 0) {
+            return;
+        }
+
         if (isCommitted())
             return;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message