tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject svn commit: r365858 - /tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java
Date Wed, 04 Jan 2006 07:48:43 GMT
Author: costin
Date: Tue Jan  3 23:48:42 2006
New Revision: 365858

URL: http://svn.apache.org/viewcvs?rev=365858&view=rev
Log:
few extra checks 

Modified:
    tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java

Modified: tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java
URL: http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java?rev=365858&r1=365857&r2=365858&view=diff
==============================================================================
--- tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java (original)
+++ tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java Tue Jan  3 23:48:42 2006
@@ -690,15 +690,19 @@
             int myPos=i+1;
 
             // not enough chars to have a match
-            if( i + srcLen >= end ) {
+            if( myPos + srcLen >= end ) {
                 break;
             }
             
+            try {
 	    for( int srcPos=srcOff + 1; srcPos< srcEnd; ) {
                 if( bb.get(myPos++) != src.charAt( srcPos++ ))
 		    break;
                 if( srcPos==srcEnd ) return i-start; // found it
 	    }
+            } catch( Throwable t ) {
+                t.printStackTrace();
+            }
 	}
 	return -1;
     }



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


Mime
View raw message