httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: [Patch 1.3] Strict proxy C-L / T-E conformance
Date Wed, 06 Jul 2005 13:12:34 GMT

On Jul 6, 2005, at 9:06 AM, Jim Jagielski wrote:

> +                char *len_end;
> +                c->len = ap_strtol(content_length, *len_end, 10);
> -        if (c->len < 0) {
> -        ap_kill_timeout(r);
> -        return ap_proxyerror(r, HTTP_BAD_GATEWAY, ap_pstrcat(r->pool,
> -                     "Invalid Content-Length from remote server",
> -                                      NULL));
> +                if ((c->len < 0) || *len_end) {
>
>
> Oops... Should be:
>
>      c->len = ap_strtol(content_length, &len_end, 10);
>
> and
>
>     if ((c->len < 0) || (len_end && *len_end))
>
> I think.. :)
>

You know, to be anal about it we should check for range errors; it  
should be:

     char *len_end;
     int errno = 0;
       ...
     if ((c->len < 0) || errno || (len_end && *len_end))

Mime
View raw message