# HG changeset patch # User Valentin Bartenev # Date 1433182136 -10800 # Node ID 4e71788460faacb8e707c3985372e5b8885046dd # Parent ab78c12412ce3ca4fb2e3021315727d9e14cb21f Fixed excessive memory usage while parsing configuration. The b->pos points to the next symbol here. Reported by ilexshen. diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c --- 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; }