tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/buf ByteChunk.java CharChunk.java
Date Tue, 05 Feb 2002 22:06:18 GMT
keith       02/02/05 14:06:18

  Modified:    src/share/org/apache/tomcat/util/buf ByteChunk.java
                        CharChunk.java
  Log:
  indexOf should return an index relative to the internal
  starting point of the string rather than the beginning
  of the array.  ByteChunk.indexOf is used to test for
  safe urls, thus some leading unsafe characters were
  being ignored.
  
  Revision  Changes    Path
  1.9       +2 -1      jakarta-tomcat/src/share/org/apache/tomcat/util/buf/ByteChunk.java
  
  Index: ByteChunk.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/buf/ByteChunk.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ByteChunk.java	19 Jul 2001 05:49:02 -0000	1.8
  +++ ByteChunk.java	5 Feb 2002 22:06:18 -0000	1.9
  @@ -626,7 +626,8 @@
        * @param s the string
        */
       public int indexOf(char c, int starting) {
  -	return indexOf( buff, start+starting, end, c);
  +	int ret = indexOf( buff, start+starting, end, c);
  +	return (ret >= start) ? ret - start : -1;
       }
   
       public static int  indexOf( byte bytes[], int off, int end, char qq )
  
  
  
  1.5       +2 -1      jakarta-tomcat/src/share/org/apache/tomcat/util/buf/CharChunk.java
  
  Index: CharChunk.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/buf/CharChunk.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CharChunk.java	19 Jul 2001 05:49:02 -0000	1.4
  +++ CharChunk.java	5 Feb 2002 22:06:18 -0000	1.5
  @@ -597,7 +597,8 @@
        * @param s the string
        */
       public int indexOf(char c, int starting) {
  -	return indexOf( buff, start+starting, end, c );
  +	int ret = indexOf( buff, start+starting, end, c );
  +	return (ret >= start) ? ret - start : -1;
       }
   
       public static int indexOf( char chars[], int off, int cend, char qq )
  
  
  

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


Mime
View raw message