details: http://hg.nginx.org/nginx/rev/4e71788460fa
branches:
changeset: 6163:4e71788460fa
user: Valentin Bartenev <vbart@nginx.com>
date: Mon Jun 01 21:08:56 2015 +0300
description:
Fixed excessive memory usage while parsing configuration.
The b->pos points to the next symbol here.
Reported by ilexshen.
diffstat:
src/core/ngx_conf_file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r ab78c12412ce -r 4e71788460fa src/core/ngx_conf_file.c
--- a/src/core/ngx_conf_file.c Mon Jun 01 16:58:07 2015 +0300
+++ b/src/core/ngx_conf_file.c Mon Jun 01 21:08:56 2015 +0300
@@ -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;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel