]> git.kaiwu.me - nginx.git/commitdiff
Added syntax checking of the second parameter of the "split_clients" directive.
authorRuslan Ermilov <ru@nginx.com>
Wed, 16 May 2012 13:14:53 +0000 (13:14 +0000)
committerRuslan Ermilov <ru@nginx.com>
Wed, 16 May 2012 13:14:53 +0000 (13:14 +0000)
src/http/modules/ngx_http_split_clients_module.c

index 726269c3c733f9bdfd29140f3ce6fa1a090e092c..33a2fe73ee7350d592cca8477d6c87e6ef99978c 100644 (file)
@@ -138,6 +138,13 @@ ngx_conf_split_clients_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     }
 
     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++;