diff src/http/ngx_http_variables.c @ 3345:d8228f0b5113

evaluate maximum captures size on configuration phase
author Igor Sysoev <igor@sysoev.ru>
date Mon, 16 Nov 2009 19:11:38 +0000
parents 1aed55182ea2
children fe08c14530e9
line wrap: on
line diff
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -1759,7 +1759,7 @@ ngx_http_regex_exec(ngx_http_request_t *
     cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
 
     if (re->ncaptures) {
-        len = (cmcf->ncaptures + 1) * 3;
+        len = cmcf->ncaptures;
 
         if (r->captures == NULL) {
             r->captures = ngx_palloc(r->pool, len * sizeof(int));