mirror of
https://github.com/nginx/nginx.git
synced 2024-12-19 05:33:52 -06:00
evaluate maximum captures size on configuration phase
This commit is contained in:
parent
d86a0bfed4
commit
42f5fb19ac
@ -2759,6 +2759,10 @@ ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf)
|
||||
cmcf->variables_hash_bucket_size =
|
||||
ngx_align(cmcf->variables_hash_bucket_size, ngx_cacheline_size);
|
||||
|
||||
if (cmcf->ncaptures) {
|
||||
cmcf->ncaptures = (cmcf->ncaptures + 1) * 3;
|
||||
}
|
||||
|
||||
return NGX_CONF_OK;
|
||||
}
|
||||
|
||||
|
@ -1759,7 +1759,7 @@ ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, ngx_str_t *s)
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user