diff src/http/ngx_http_core_module.c @ 4710:5a4666d4b6cb stable-1.2

Merge of r4636, r4637, r4638: config sanity checks. *) Added syntax checking of the second parameter of the "split_clients" directive. *) Capped the status code that may be returned with "return" and "try_files". *) Zero padded the returned and logged HTTP status code, and fixed possible buffer overrun in $status handling.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 29 Jun 2012 17:28:41 +0000
parents ba2c7463ce18
children 7d0c7bf2874d
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -4662,7 +4662,7 @@ ngx_http_core_try_files(ngx_conf_t *cf, 
 
         code = ngx_atoi(tf[i - 1].name.data + 1, tf[i - 1].name.len - 2);
 
-        if (code == NGX_ERROR) {
+        if (code == NGX_ERROR || code > 999) {
             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                                "invalid code \"%*s\"",
                                tf[i - 1].name.len - 1, tf[i - 1].name.data);