httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Burry <dbu...@tagnet.org>
Subject Re: cvs commit: apache-1.3/src/main http_protocol.c
Date Tue, 09 Jul 2002 20:59:34 GMT
While we are debating the best way to accomplish this Content-Length fix for the next release,
I kind of need to have it working for me right now in the current released version.  Therefore
I've implemented this partial fix against 1.3.26 on my system:

root@nueva[391] pwd
/usr/share/src/packages/apache_1.3.26/src/main
root@nueva[392] diff -c http_protocol.original.c http_protocol.c
*** http_protocol.original.c    Tue Jul  9 13:35:54 2002
--- http_protocol.c     Tue Jul  9 12:35:59 2002
***************
*** 1991,1997 ****
  
          r->read_chunked = 1;
      }
!     else if (lenp) {
          const char *pos = lenp;
          int conversion_error = 0;
  
--- 1991,1997 ----
  
          r->read_chunked = 1;
      }
!     else if (lenp && *lenp != '\0') {
          const char *pos = lenp;
          int conversion_error = 0;

Admittedly it only opens up empty string (blank) Content-Length values to default to 0, not
white space ones, but I think that's all I really need to get me going for now until the next
release.  I believe this may be the "simple check of *lenp" that Roy was talking about.  Since
I'm brand new to the Apache source code in general, and not really a C expert either, any
comments or criticisms are welcome regarding this.

Dave



At 11:18 AM 7/9/2002 -0700, Roy T. Fielding wrote:
>WTF?  -1   Jim, that code is doing an error check prior to the
>strtol.  It is not looking for the start of the number, but
>ensuring that the number is non-negative and all digits prior
>to calling the library routine.  A simple check of *lenp would
>have been sufficient for the blank case.


Mime
View raw message