diff src/http/ngx_http_request.c @ 467: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
line wrap: on
line diff
--- 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;
                 }