Mercurial > hg > nginx-quic
comparison src/core/ngx_conf_file.c @ 6163:4e71788460fa
Fixed excessive memory usage while parsing configuration.
The b->pos points to the next symbol here.
Reported by ilexshen.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 01 Jun 2015 21:08:56 +0300 |
parents | f87afb46ccd2 |
children | 1b7e246e6b38 |
comparison
equal
deleted
inserted
replaced
6162:ab78c12412ce | 6163:4e71788460fa |
---|---|
678 word = ngx_array_push(cf->args); | 678 word = ngx_array_push(cf->args); |
679 if (word == NULL) { | 679 if (word == NULL) { |
680 return NGX_ERROR; | 680 return NGX_ERROR; |
681 } | 681 } |
682 | 682 |
683 word->data = ngx_pnalloc(cf->pool, b->pos - start + 1); | 683 word->data = ngx_pnalloc(cf->pool, b->pos - 1 - start + 1); |
684 if (word->data == NULL) { | 684 if (word->data == NULL) { |
685 return NGX_ERROR; | 685 return NGX_ERROR; |
686 } | 686 } |
687 | 687 |
688 for (dst = word->data, src = start, len = 0; | 688 for (dst = word->data, src = start, len = 0; |