Klaus Demo nginx / ba29009
Fixed variable syntax checking in "set", "geo", "limit_conn_zone", and "perl_set" directives. Ruslan Ermilov 9 years ago
4 changed file(s) with 11 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
321321 }
322322
323323 name = value[1];
324
325 if (name.len < 2 || name.data[0] != '$') {
326 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
327 "invalid variable name \"%V\"", &name);
328 return NGX_CONF_ERROR;
329 }
330
324331 name.len--;
325332 name.data++;
326333
539539 continue;
540540 }
541541
542 if (value[i].data[0] == '$') {
542 if (value[i].len > 1 && value[i].data[0] == '$') {
543543
544544 value[i].len--;
545545 value[i].data++;
612612
613613 value = cf->args->elts;
614614
615 if (value[2].data[0] != '$') {
615 if (value[2].len < 2 || value[2].data[0] != '$') {
616616 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
617617 "invalid variable name \"%V\"", &value[2]);
618618 return NGX_CONF_ERROR;
907907
908908 value = cf->args->elts;
909909
910 if (value[1].data[0] != '$') {
910 if (value[1].len < 2 || value[1].data[0] != '$') {
911911 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
912912 "invalid variable name \"%V\"", &value[1]);
913913 return NGX_CONF_ERROR;
967967
968968 value = cf->args->elts;
969969
970 if (value[1].data[0] != '$') {
970 if (value[1].len < 2 || value[1].data[0] != '$') {
971971 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
972972 "invalid variable name \"%V\"", &value[1]);
973973 return NGX_CONF_ERROR;