Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_limit_conn_module.c @ 4972:8b635cf36ccc
Added checks that disallow adding a variable with an empty name.
Added variable name syntax checks to "geo" and "map" directives.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Mon, 17 Dec 2012 19:03:33 +0000 |
parents | 9f4cdc7a8578 |
children | 00e4459739ed |
comparison
equal
deleted
inserted
replaced
4971:eaf95350d75c | 4972:8b635cf36ccc |
---|---|
538 } | 538 } |
539 | 539 |
540 continue; | 540 continue; |
541 } | 541 } |
542 | 542 |
543 if (value[i].len > 1 && value[i].data[0] == '$') { | 543 if (value[i].data[0] == '$') { |
544 | 544 |
545 value[i].len--; | 545 value[i].len--; |
546 value[i].data++; | 546 value[i].data++; |
547 | 547 |
548 ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_conn_ctx_t)); | 548 ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_conn_ctx_t)); |
611 | 611 |
612 ngx_conf_deprecated(cf, &ngx_conf_deprecated_limit_zone, NULL); | 612 ngx_conf_deprecated(cf, &ngx_conf_deprecated_limit_zone, NULL); |
613 | 613 |
614 value = cf->args->elts; | 614 value = cf->args->elts; |
615 | 615 |
616 if (value[2].len < 2 || value[2].data[0] != '$') { | 616 if (value[2].data[0] != '$') { |
617 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 617 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
618 "invalid variable name \"%V\"", &value[2]); | 618 "invalid variable name \"%V\"", &value[2]); |
619 return NGX_CONF_ERROR; | 619 return NGX_CONF_ERROR; |
620 } | 620 } |
621 | 621 |