changeset 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 cc8fb8cd98bb
children 6ef558ffc0eb
files CHANGES CHANGES.ru src/core/nginx.h src/http/modules/perl/nginx.pm src/http/ngx_http_core_module.c src/http/ngx_http_request.c
diffstat 6 files changed, 24 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Mon Mar 09 00:00:00 2009 +0300
+++ b/CHANGES	Wed Mar 11 00:00:00 2009 +0300
@@ -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 
--- a/CHANGES.ru	Mon Mar 09 00:00:00 2009 +0300
+++ b/CHANGES.ru	Wed Mar 11 00:00:00 2009 +0300
@@ -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 поддерживает выделения в регулярных 
--- a/src/core/nginx.h	Mon Mar 09 00:00:00 2009 +0300
+++ b/src/core/nginx.h	Wed Mar 11 00:00:00 2009 +0300
@@ -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"
--- a/src/http/modules/perl/nginx.pm	Mon Mar 09 00:00:00 2009 +0300
+++ b/src/http/modules/perl/nginx.pm	Wed Mar 11 00:00:00 2009 +0300
@@ -47,7 +47,7 @@
     HTTP_INSUFFICIENT_STORAGE
 );
 
-our $VERSION = '0.7.40';
+our $VERSION = '0.7.41';
 
 require XSLoader;
 XSLoader::load('nginx', $VERSION);
--- a/src/http/ngx_http_core_module.c	Mon Mar 09 00:00:00 2009 +0300
+++ b/src/http/ngx_http_core_module.c	Wed Mar 11 00:00:00 2009 +0300
@@ -1380,9 +1380,9 @@
 
             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;
                 }
--- a/src/http/ngx_http_request.c	Mon Mar 09 00:00:00 2009 +0300
+++ b/src/http/ngx_http_request.c	Wed Mar 11 00:00:00 2009 +0300
@@ -1662,9 +1662,9 @@
 
             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;
                 }