Mercurial > hg > nginx
changeset 797:36f7b549f481
fix segfault if $server_addr failed
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 20 Oct 2006 19:07:50 +0000 |
parents | 3db9dd3d9d8c |
children | 97e89a42711f |
files | src/http/modules/ngx_http_charset_filter_module.c src/http/modules/ngx_http_map_module.c src/http/ngx_http_variables.c |
diffstat | 3 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_charset_filter_module.c Fri Oct 20 12:22:39 2006 +0000 +++ b/src/http/modules/ngx_http_charset_filter_module.c Fri Oct 20 19:07:50 2006 +0000 @@ -250,6 +250,10 @@ vv = ngx_http_get_indexed_variable(r, charset - NGX_HTTP_CHARSET_VAR); + if (vv == NULL || vv->not_found) { + return NGX_ERROR; + } + charset = ngx_http_charset_get_charset(charsets, n, (ngx_str_t *) vv); } @@ -293,6 +297,10 @@ vv = ngx_http_get_indexed_variable(r, source_charset - NGX_HTTP_CHARSET_VAR); + if (vv == NULL || vv->not_found) { + return NGX_ERROR; + } + source_charset = ngx_http_charset_get_charset(charsets, n, (ngx_str_t *) vv); }
--- a/src/http/modules/ngx_http_map_module.c Fri Oct 20 12:22:39 2006 +0000 +++ b/src/http/modules/ngx_http_map_module.c Fri Oct 20 19:07:50 2006 +0000 @@ -115,6 +115,11 @@ vv = ngx_http_get_flushed_variable(r, map->index); + if (vv == NULL || vv->not_found) { + *v = *map->default_value; + return NGX_OK; + } + len = vv->len; if (len && map->hostnames && vv->data[len - 1] == '.') {