mirror of
https://github.com/nginx/nginx.git
synced 2025-07-20 19:27:29 +08:00
Merge 674c5c7e63
into c52c5698cd
This commit is contained in:
commit
d48da9f1ed
@ -163,6 +163,12 @@ ngx_http_static_handler(ngx_http_request_t *r)
|
|||||||
len = r->uri.len + 1;
|
len = r->uri.len + 1;
|
||||||
location = path.data + root;
|
location = path.data + root;
|
||||||
|
|
||||||
|
if (location == NULL) {
|
||||||
|
ngx_http_clear_location(r);
|
||||||
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
*last = '/';
|
*last = '/';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -189,6 +195,17 @@ ngx_http_static_handler(ngx_http_request_t *r)
|
|||||||
*last = '/';
|
*last = '/';
|
||||||
|
|
||||||
if (r->args.len) {
|
if (r->args.len) {
|
||||||
|
|
||||||
|
if (last == NULL) {
|
||||||
|
ngx_http_clear_location(r);
|
||||||
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ((size_t)((location + len) - (last + 1)) < r->args.len) {
|
||||||
|
ngx_http_clear_location(r);
|
||||||
|
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||||
|
}
|
||||||
*++last = '?';
|
*++last = '?';
|
||||||
ngx_memcpy(++last, r->args.data, r->args.len);
|
ngx_memcpy(++last, r->args.data, r->args.len);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user