fix segfault when $fastcgi_script_name is used in access_log

and there was bad request (400)
This commit is contained in:
Igor Sysoev 2007-02-09 11:56:23 +00:00
parent e980185ee0
commit f0b150faf8

View File

@ -1969,6 +1969,7 @@ ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
u_char *p;
ngx_http_fastcgi_loc_conf_t *flcf;
if (r->uri.len) {
v->valid = 1;
v->no_cachable = 0;
v->not_found = 0;
@ -1991,6 +1992,16 @@ ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
p = ngx_copy(v->data, r->uri.data, r->uri.len);
ngx_memcpy(p, flcf->index.data, flcf->index.len);
} else {
v->len = 0;
v->valid = 1;
v->no_cachable = 0;
v->not_found = 0;
v->data = NULL;
return NGX_OK;
}
return NGX_OK;
}