From 66f6ba5c954af4e4bef314fad32e9de9f4329c52 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Mon, 1 Jun 2015 21:08:56 +0300 Subject: Fixed excessive memory usage while parsing configuration. The b->pos points to the next symbol here. Reported by ilexshen. --- src/core/ngx_conf_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/ngx_conf_file.c') diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index ec3c1fae1..8273a7fcd 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -680,7 +680,7 @@ ngx_conf_read_token(ngx_conf_t *cf) return NGX_ERROR; } - word->data = ngx_pnalloc(cf->pool, b->pos - start + 1); + word->data = ngx_pnalloc(cf->pool, b->pos - 1 - start + 1); if (word->data == NULL) { return NGX_ERROR; } -- cgit