From befc111d4f1b0986998e7fa0451f52e874afcb19 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Wed, 16 May 2012 13:22:03 +0000 Subject: Capped the status code that may be returned with "return" and "try_files". --- src/http/modules/ngx_http_rewrite_module.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/http/modules') diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c index 74d26e524..4081f8774 100644 --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -485,6 +485,12 @@ ngx_http_rewrite_return(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } else { + if (ret->status > 999) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "invalid return code \"%V\"", &value[1]); + return NGX_CONF_ERROR; + } + if (cf->args->nelts == 2) { return NGX_CONF_OK; } -- cgit