comparison src/http/ngx_http_request.c @ 458:2e2b57743e87 NGINX_0_7_41

nginx 0.7.41 *) Bugfix: a segmentation fault might occur in worker process, if a "server_name" or a "location" directives had captures in regular expressions; the issue had appeared in 0.7.40. Thanks to Vladimir Sopot.
author Igor Sysoev <http://sysoev.ru>
date Wed, 11 Mar 2009 00:00:00 +0300
parents ca8f7f6cab16
children bb941a2996a6
comparison
equal deleted inserted replaced
457:cc8fb8cd98bb 458:2e2b57743e87
1660 1660
1661 for (i = 0; i < vn->nregex; i++) { 1661 for (i = 0; i < vn->nregex; i++) {
1662 1662
1663 if (sn[i].captures && r->captures == NULL) { 1663 if (sn[i].captures && r->captures == NULL) {
1664 1664
1665 ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3 * sizeof(int); 1665 ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3;
1666 1666
1667 r->captures = ngx_palloc(r->pool, ncaptures); 1667 r->captures = ngx_palloc(r->pool, ncaptures * sizeof(int));
1668 if (r->captures == NULL) { 1668 if (r->captures == NULL) {
1669 return NGX_ERROR; 1669 return NGX_ERROR;
1670 } 1670 }
1671 1671
1672 if (server == buf) { 1672 if (server == buf) {