# HG changeset patch # User Igor Sysoev # Date 1236718800 -10800 # Node ID 2e2b57743e871f3e1aa5994b693da5d248df5800 # Parent cc8fb8cd98bb094ec16e793f32b8ca415ec01498 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. diff --git a/CHANGES b/CHANGES --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,12 @@ +Changes with nginx 0.7.41 11 Mar 2009 + + *) 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. + + Changes with nginx 0.7.40 09 Mar 2009 *) Feature: the "location" directive supports captures in regular diff --git a/CHANGES.ru b/CHANGES.ru --- a/CHANGES.ru +++ b/CHANGES.ru @@ -1,4 +1,12 @@ +Изменения в nginx 0.7.41 11.03.2009 + + *) Исправление: в рабочем процессе мог произойти segmentation fault, + если в server_name или location были выделения в регулярных + выражениях; ошибка появилась в 0.7.40. + Спасибо Владимиру Сопоту. + + Изменения в nginx 0.7.40 09.03.2009 *) Добавление: директива location поддерживает выделения в регулярных diff --git a/src/core/nginx.h b/src/core/nginx.h --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -8,7 +8,7 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VERSION "0.7.40" +#define NGINX_VERSION "0.7.41" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm --- a/src/http/modules/perl/nginx.pm +++ b/src/http/modules/perl/nginx.pm @@ -47,7 +47,7 @@ our @EXPORT = qw( HTTP_INSUFFICIENT_STORAGE ); -our $VERSION = '0.7.40'; +our $VERSION = '0.7.41'; require XSLoader; XSLoader::load('nginx', $VERSION); diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1380,9 +1380,9 @@ ngx_http_core_find_location(ngx_http_req if ((*clcfp)->captures && r->captures == NULL) { - len = (NGX_HTTP_MAX_CAPTURES + 1) * 3 * sizeof(int); - - r->captures = ngx_palloc(r->pool, len); + len = (NGX_HTTP_MAX_CAPTURES + 1) * 3; + + r->captures = ngx_palloc(r->pool, len * sizeof(int)); if (r->captures == NULL) { return NGX_ERROR; } diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1662,9 +1662,9 @@ ngx_http_find_virtual_server(ngx_http_re if (sn[i].captures && r->captures == NULL) { - ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3 * sizeof(int); - - r->captures = ngx_palloc(r->pool, ncaptures); + ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3; + + r->captures = ngx_palloc(r->pool, ncaptures * sizeof(int)); if (r->captures == NULL) { return NGX_ERROR; }