diff options
author | Ruslan Ermilov <ru@nginx.com> | 2011-10-12 09:36:21 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2011-10-12 09:36:21 +0000 |
commit | fc559626989b7ee884ea021809387617aa6c7cd1 (patch) | |
tree | c80e790607c774c830c12a5244fc8cda80e02977 /src/http/ngx_http_core_module.c | |
parent | b5c3336e3e3508c62fceb2177ea0310690da36cc (diff) | |
download | nginx-fc559626989b7ee884ea021809387617aa6c7cd1.tar.gz nginx-fc559626989b7ee884ea021809387617aa6c7cd1.zip |
Fixed two minor bugs in "types" parsing code.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r-- | src/http/ngx_http_core_module.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 1a6d48eea..22f5bdff2 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -2994,6 +2994,12 @@ ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) value = cf->args->elts; if (ngx_strcmp(value[0].data, "include") == 0) { + if (cf->args->nelts != 2) { + ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, + "invalid number of arguments" + " in \"include\" directive"); + return NGX_CONF_ERROR; + } file = value[1]; if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) { @@ -3027,7 +3033,7 @@ ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) "content type: \"%V\", " "previous content type: \"%V\"", &value[i], content_type, old); - continue; + goto next; } } @@ -3040,6 +3046,9 @@ ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) type->key = value[i]; type->key_hash = hash; type->value = content_type; + + next: + continue; } return NGX_CONF_OK; |