Remove unneeded line from the method that normalizes decodedURI.
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 21 Dec 2009 13:20:01 +0000 (13:20 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 21 Dec 2009 13:20:01 +0000 (13:20 +0000)
The line "uriBC.setBytes(b, start, end);" is wrong, as it should have been "uriBC.setBytes(b, start, end - start);". I suppose that it worked because in the only place that calls this normalize() method the value of 'start' was always equal to zero.

Instead of fixing, I am removing that line, because it actually is not needed there at all, thanks to the uriBC.setEnd() calls above it.

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

java/org/apache/catalina/connector/CoyoteAdapter.java

index 5140776..c1ed81e 100644 (file)
@@ -832,8 +832,8 @@ public class CoyoteAdapter
     public static boolean normalize(MessageBytes uriMB) {
 
         ByteChunk uriBC = uriMB.getByteChunk();
-        byte[] b = uriBC.getBytes();
-        int start = uriBC.getStart();
+        final byte[] b = uriBC.getBytes();
+        final int start = uriBC.getStart();
         int end = uriBC.getEnd();
 
         // An empty URL is not acceptable
@@ -927,8 +927,6 @@ public class CoyoteAdapter
             index = index2;
         }
 
-        uriBC.setBytes(b, start, end);
-
         return true;
 
     }