tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r953434 - /tomcat/trunk/java/org/apache/catalina/connector/Request.java
Date Thu, 10 Jun 2010 19:58:49 GMT
Author: markt
Date: Thu Jun 10 19:58:49 2010
New Revision: 953434

URL: http://svn.apache.org/viewvc?rev=953434&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49424
Avoid NPE if no input data is provided in a chunked POST request

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

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=953434&r1=953433&r2=953434&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Thu Jun 10 19:58:49 2010
@@ -2818,7 +2818,9 @@ public class Request
                 }
                 return;
             }
-            parameters.processParameters(formData, 0, formData.length);
+            if (formData != null) {
+                parameters.processParameters(formData, 0, formData.length);
+            }
         }
 
     }
@@ -2864,6 +2866,9 @@ public class Request
                 body.append(buffer, 0, len);
             }
         }
+        if (body.getLength() == 0) {
+            return null;
+        }
         if (body.getLength() < body.getBuffer().length) {
             int length = body.getLength();
             byte[] result = new byte[length];



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


Mime
View raw message