changeset 4635:9c9fbdbe9383

Added syntax checking of the second parameter of the "split_clients" directive.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 16 May 2012 13:14:53 +0000
parents b0e48bacb301
children ed957e0daeb4
files src/http/modules/ngx_http_split_clients_module.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_split_clients_module.c
+++ b/src/http/modules/ngx_http_split_clients_module.c
@@ -138,6 +138,13 @@ ngx_conf_split_clients_block(ngx_conf_t 
     }
 
     name = value[2];
+
+    if (name.len < 2 || name.data[0] != '$') {
+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                           "invalid variable name \"%V\"", &name);
+        return NGX_CONF_ERROR;
+    }
+
     name.len--;
     name.data++;