summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_charset_filter_module.c8
-rw-r--r--src/http/modules/ngx_http_map_module.c5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c
index b9c9ade91..cae9bbe53 100644
--- a/src/http/modules/ngx_http_charset_filter_module.c
+++ b/src/http/modules/ngx_http_charset_filter_module.c
@@ -250,6 +250,10 @@ ngx_http_charset_header_filter(ngx_http_request_t *r)
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 @@ ngx_http_charset_header_filter(ngx_http_request_t *r)
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);
}
diff --git a/src/http/modules/ngx_http_map_module.c b/src/http/modules/ngx_http_map_module.c
index 0a533c0f5..fb8e8ee60 100644
--- a/src/http/modules/ngx_http_map_module.c
+++ b/src/http/modules/ngx_http_map_module.c
@@ -115,6 +115,11 @@ ngx_http_map_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
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] == '.') {