aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_rewrite_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_rewrite_module.c')
-rw-r--r--src/http/modules/ngx_http_rewrite_module.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c
index 3b49c455c..0e6d4df64 100644
--- a/src/http/modules/ngx_http_rewrite_module.c
+++ b/src/http/modules/ngx_http_rewrite_module.c
@@ -318,6 +318,11 @@ ngx_http_rewrite(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
value = cf->args->elts;
+ if (value[2].len == 0) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "empty replacement");
+ return NGX_CONF_ERROR;
+ }
+
ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
rc.pattern = value[1];