mirror of
https://github.com/nginx/nginx.git
synced 2025-06-10 11:38:36 +08:00
fix segfault introduced in r2486 in $sent_http_location processing
This commit is contained in:
parent
d7b3b48f0e
commit
3e7e9d72e5
@ -1316,6 +1316,8 @@ static ngx_int_t
|
|||||||
ngx_http_variable_sent_location(ngx_http_request_t *r,
|
ngx_http_variable_sent_location(ngx_http_request_t *r,
|
||||||
ngx_http_variable_value_t *v, uintptr_t data)
|
ngx_http_variable_value_t *v, uintptr_t data)
|
||||||
{
|
{
|
||||||
|
ngx_str_t name;
|
||||||
|
|
||||||
if (r->headers_out.location) {
|
if (r->headers_out.location) {
|
||||||
v->len = r->headers_out.location->value.len;
|
v->len = r->headers_out.location->value.len;
|
||||||
v->valid = 1;
|
v->valid = 1;
|
||||||
@ -1326,7 +1328,10 @@ ngx_http_variable_sent_location(ngx_http_request_t *r,
|
|||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ngx_http_variable_unknown_header(v, (ngx_str_t *) data,
|
name.len = sizeof("sent_http_location") - 1;
|
||||||
|
name.data = (u_char *) "sent_http_location";
|
||||||
|
|
||||||
|
return ngx_http_variable_unknown_header(v, &name,
|
||||||
&r->headers_out.headers.part,
|
&r->headers_out.headers.part,
|
||||||
sizeof("sent_http_") - 1);
|
sizeof("sent_http_") - 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user