You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@apache.org on 2001/06/01 05:37:28 UTC

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http HttpRequestStream.java

craigmcc    01/05/31 20:37:28

  Modified:    catalina/src/share/org/apache/catalina/connector/http
                        HttpRequestStream.java
  Log:
  Correct a potential NullPointerException where readLineFromStream() might
  return null because of network errors or other transient conditions.  I
  don't *think* any of the other uses of readLineFromStream() are subject to
  this kind of problem.
  
  Thanks for the patch!!!
  
  Submitted by: Michael Smith <ms...@xn.com.au>
  
  Revision  Changes    Path
  1.9       +6 -4      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java
  
  Index: HttpRequestStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- HttpRequestStream.java	2001/02/20 21:38:44	1.8
  +++ HttpRequestStream.java	2001/06/01 03:37:28	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v 1.8 2001/02/20 21:38:44 remm Exp $
  - * $Revision: 1.8 $
  - * $Date: 2001/02/20 21:38:44 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v 1.9 2001/06/01 03:37:28 craigmcc Exp $
  + * $Revision: 1.9 $
  + * $Date: 2001/06/01 03:37:28 $
    *
    * ====================================================================
    * 
  @@ -267,7 +267,9 @@
           chunkPos = 0;
           
           try {
  -            String numberValue = readLineFromStream().trim();
  +            String numberValue = readLineFromStream();
  +            if (numberValue != null)
  +                numberValue = numberValue.trim();
               chunkLength = 
                   Integer.parseInt(numberValue, 16);
           } catch (NumberFormatException e) {