Author: markt
Date: Wed Jan  8 18:01:14 2014
New Revision: 1556591

URL: http://svn.apache.org/r1556591
Log:
Avoid possible NPE when a content type with no charset is specified
(Followup to r1548971)

Modified:
    tomcat/tc6.0.x/trunk/   (props changed)
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/Response.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc6.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1552804
  Merged /tomcat/tc7.0.x/trunk:r1552805

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1556591&r1=1556590&r2=1556591&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jan  8 18:01:14 2014
@@ -72,12 +72,6 @@ PATCHES PROPOSED TO BACKPORT:
       requires Ant >= 1.8.0).
   -1:
 
-* Avoid possible NPE when a content type with no charset is specified
-  (Followup to r1548971)
-  http://svn.apache.org/r1552805
-  +1: markt, kkolinko, remm, jboynes
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55973
   Fix processing of XML schemas when validation is enabled in Jasper
   http://svn.apache.org/r1556377

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/Response.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/Response.java?rev=1556591&r1=1556590&r2=1556591&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/Response.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/Response.java Wed Jan  8 
18:01:14 2014
@@ -478,11 +478,14 @@ public final class Response {
 
         this.contentType = m.toStringNoCharset();
 
-        String charsetValue = m.getCharset().trim();
+        String charsetValue = m.getCharset();
 
-        if (charsetValue != null && charsetValue.length() > 0) {
-            charsetSet = true;
-            this.characterEncoding = charsetValue;
+        if (charsetValue != null) {
+            charsetValue = charsetValue.trim();
+            if (charsetValue.length() > 0) {
+                charsetSet = true;
+                this.characterEncoding = charsetValue;
+            }
         }
     }
 

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1556591&r1=1556590&r2=1556591&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Jan  8 18:01:14 2014
@@ -132,6 +132,10 @@
         in the AprLifecycleListener and SSL is configured for an APR/native
         connector. (markt)
       </fix>
+      <fix>
+        Avoid possible NPE if a content type is specified without a character 
set.
+        (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">



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

Reply via email to