comparison src/http/modules/ngx_http_geo_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 90d8c3400769
children 76dacc97f23c
comparison
equal deleted inserted replaced
4971:eaf95350d75c 4972:8b635cf36ccc
323 return NGX_CONF_ERROR; 323 return NGX_CONF_ERROR;
324 } 324 }
325 325
326 name = value[1]; 326 name = value[1];
327 327
328 if (name.len < 2 || name.data[0] != '$') { 328 if (name.data[0] != '$') {
329 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 329 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
330 "invalid variable name \"%V\"", &name); 330 "invalid variable name \"%V\"", &name);
331 return NGX_CONF_ERROR; 331 return NGX_CONF_ERROR;
332 } 332 }
333 333
340 if (geo->index == NGX_ERROR) { 340 if (geo->index == NGX_ERROR) {
341 return NGX_CONF_ERROR; 341 return NGX_CONF_ERROR;
342 } 342 }
343 343
344 name = value[2]; 344 name = value[2];
345
346 if (name.data[0] != '$') {
347 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
348 "invalid variable name \"%V\"", &name);
349 return NGX_CONF_ERROR;
350 }
351
345 name.len--; 352 name.len--;
346 name.data++; 353 name.data++;
347 354
348 } else { 355 } else {
349 geo->index = -1; 356 geo->index = -1;