You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2002/02/21 04:04:20 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server Ajp13Packet.java

billbarker    02/02/20 19:04:20

  Modified:    src/share/org/apache/tomcat/modules/server Ajp13Packet.java
  Log:
  Sanity check the output dump when debugging Ajp13.
  
  The problem is that on read, 'len' includes the header, and on write it doesn't.  Now it won't try and dump past the end of the output.
  
  Fix for bug #6579.
  Reported by: Hans Schmid hans.schmid@einsurance.de
  
  Revision  Changes    Path
  1.5       +5 -2      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Packet.java
  
  Index: Ajp13Packet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13Packet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Ajp13Packet.java	14 Sep 2001 15:57:45 -0000	1.4
  +++ Ajp13Packet.java	21 Feb 2002 03:04:20 -0000	1.5
  @@ -385,14 +385,17 @@
       }
       
       private void hexLine( int start , StringBuffer sb) {
  +	int pkgEnd = len + 4;
  +	if( pkgEnd > buff.length )
  +	    pkgEnd = buff.length;
   	for( int i=start; i< start+16 ; i++ ) {
  -	    if( i < len + 4)
  +	    if( i < pkgEnd)
   		sb.append( hex( buff[i] ) + " ");
   	    else 
   		sb.append( "   " );
   	}
   	sb.append(" | ");
  -	for( int i=start; i < start+16 && i < len + 4; i++ ) {
  +	for( int i=start; i < start+16 && i < pkgEnd; i++ ) {
   	    char c=(char)buff[i];
   	    if( ! Character.isISOControl(c) &&
   		Character.isDefined(c) )
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>