Mercurial > hg > nginx
comparison src/http/modules/ngx_http_map_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 | 6e46016ea276 |
children | 5482671df278 |
comparison
equal
deleted
inserted
replaced
4971:eaf95350d75c | 4972:8b635cf36ccc |
---|---|
207 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { | 207 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { |
208 return NGX_CONF_ERROR; | 208 return NGX_CONF_ERROR; |
209 } | 209 } |
210 | 210 |
211 name = value[2]; | 211 name = value[2]; |
212 | |
213 if (name.data[0] != '$') { | |
214 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
215 "invalid variable name \"%V\"", &name); | |
216 return NGX_CONF_ERROR; | |
217 } | |
218 | |
212 name.len--; | 219 name.len--; |
213 name.data++; | 220 name.data++; |
214 | 221 |
215 var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); | 222 var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); |
216 if (var == NULL) { | 223 if (var == NULL) { |