httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From field...@apache.org
Subject cvs commit: httpd-2.0/modules/http http_protocol.c
Date Tue, 18 Jun 2002 00:14:22 GMT
fielding    2002/06/17 17:14:22

  Modified:    modules/http http_protocol.c
  Log:
  It isn't valid to check errno without setting it first, unless an
  error return value already indicated that errno was set.  Also, we might
  as well accept any error or junk remaining in the field as a parse error.
  
  Revision  Changes    Path
  1.439     +6 -2      httpd-2.0/modules/http/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
  retrieving revision 1.438
  retrieving revision 1.439
  diff -u -r1.438 -r1.439
  --- http_protocol.c	17 Jun 2002 22:46:30 -0000	1.438
  +++ http_protocol.c	18 Jun 2002 00:14:21 -0000	1.439
  @@ -803,10 +803,12 @@
   
               if (*pos == '\0') {
                   char *endstr;
  +
  +                errno = 0;
                   ctx->state = BODY_LENGTH;
                   ctx->remaining = strtol(lenp, &endstr, 10);
   
  -                if (errno == ERANGE) {
  +                if (errno || (endstr && *endstr)) {
                       conversion_error = 1; 
                   }
               }
  @@ -1714,9 +1716,11 @@
   
           if (*pos == '\0') {
               char *endstr;
  +
  +            errno = 0;
               r->remaining = strtol(lenp, &endstr, 10);
   
  -            if (errno == ERANGE || errno == EINVAL) {
  +            if (errno || (endstr && *endstr)) {
                   conversion_error = 1; 
               }
           }
  
  
  

Mime
View raw message