diff options
author | Valentin Bartenev <vbart@nginx.com> | 2013-05-23 20:30:27 +0400 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2013-05-23 20:30:27 +0400 |
commit | c8702948dbe97866bb6f4fadf8773f5fd5a3d374 (patch) | |
tree | 594652ac7c74cc6d60cc898dbcf59ce63608c5c9 /src/core/ngx_conf_file.c | |
parent | 2c0ea0fcc854a1ba0c717fa78b03ac7faee12829 (diff) | |
download | nginx-c8702948dbe97866bb6f4fadf8773f5fd5a3d374.tar.gz nginx-c8702948dbe97866bb6f4fadf8773f5fd5a3d374.zip |
Core: strengthen configuration syntax checker.
It is now a syntax error if tokens passed to a custom configuration
handler are terminated by "{".
The following incorrect configuration is now properly rejected:
map $v $v2 {
a b {
c d {
e f {
}
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r-- | src/core/ngx_conf_file.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index a26267213..0d12ec2cd 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -225,6 +225,11 @@ ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename) * "types { ... }" directive */ + if (rc == NGX_CONF_BLOCK_START) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "unexpected \"{\""); + goto failed; + } + rv = (*cf->handler)(cf, NULL, cf->handler_conf); if (rv == NGX_CONF_OK) { continue; |