[bug] bug in ngx_http_proxy_module.c version 0.5.31

Igor Sysoev is at rambler-co.ru
Sat Sep 15 00:34:08 MSD 2007


On Fri, Sep 14, 2007 at 10:13:27PM +0200, Manlio Perillo wrote:

> Igor, I have found a possible bug in the proxy module.
> 
> The problem is with this piece of code, at line 1139:
> 
> if (h->key.len == r->lowcase_index) {
>     ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
> } else {
>     for (i = 0; i < h->key.len; i++) {
>         h->lowcase_key[i] = ngx_tolower(h->lowcase_key[i]);
>     }
> }
> 
> 
> When h->key.len != r->lowcase_index h, h->lowcase_key will contain no data.
> 
> It should be:
> h->lowcase_key[i] = ngx_tolower(h->key.data[i]);

You are right, thank you.

Upstream header whose name is longer than 32 bytes is handled incorrectly
by proxy_hide_header and fastcgi_hide_header directive.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list