]> git.kaiwu.me - nginx.git/commitdiff
Split clients: check length when parsing configuration.
authorRuslan Ermilov <ru@nginx.com>
Thu, 21 Mar 2013 16:06:53 +0000 (16:06 +0000)
committerRuslan Ermilov <ru@nginx.com>
Thu, 21 Mar 2013 16:06:53 +0000 (16:06 +0000)
src/http/modules/ngx_http_split_clients_module.c

index 992f6de7c1bd10c69b234452386de39d4b2732ab..2f92c9e1a8fc153bb95bf8744b61978c0ef0e2d3 100644 (file)
@@ -218,7 +218,7 @@ ngx_http_split_clients(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
         part->percent = 0;
 
     } else {
-        if (value[0].data[value[0].len - 1] != '%') {
+        if (value[0].len == 0 || value[0].data[value[0].len - 1] != '%') {
             goto invalid;
         }