diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-02-25 01:02:08 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-02-25 01:02:08 +0300 |
commit | 3e7e9d72e512674c4faa75d92f350fbad8da7e9e (patch) | |
tree | 221fc29d051c4c466d26bf9b85c999545258c1ac | |
parent | d7b3b48f0ee5cc33f44315c541fec3bf72fe4bc1 (diff) |
fix segfault introduced in r2486 in $sent_http_location processing
-rw-r--r-- | src/http/ngx_http_variables.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c index 360f8376f..0c46c35fa 100644 --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -1316,6 +1316,8 @@ static ngx_int_t ngx_http_variable_sent_location(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) { + ngx_str_t name; + if (r->headers_out.location) { v->len = r->headers_out.location->value.len; v->valid = 1; @@ -1326,7 +1328,10 @@ ngx_http_variable_sent_location(ngx_http_request_t *r, 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, sizeof("sent_http_") - 1); } |