diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-03-11 16:04:02 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-03-11 16:04:02 +0300 |
commit | 000609ae76d7e1568c0288c6498a0c16fc005fa9 (patch) | |
tree | 21dcb1fac817e21b8b5dfb5bbfd2369fe0c7f92c /src | |
parent | da404fcfe5d9556d210b45dc281a8bc0265a6a33 (diff) |
fix segfaults introduced in r2549 and r2550
Diffstat (limited to 'src')
-rw-r--r-- | src/http/ngx_http_core_module.c | 4 | ||||
-rw-r--r-- | src/http/ngx_http_request.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index ad009462e..a2d4e8688 100644 --- 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_request_t *r) if ((*clcfp)->captures && r->captures == NULL) { - len = (NGX_HTTP_MAX_CAPTURES + 1) * 3 * sizeof(int); + len = (NGX_HTTP_MAX_CAPTURES + 1) * 3; - r->captures = ngx_palloc(r->pool, len); + 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 index 95a392a82..c018d6868 100644 --- 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_request_t *r, u_char *host, size_t len) if (sn[i].captures && r->captures == NULL) { - ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3 * sizeof(int); + ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3; - r->captures = ngx_palloc(r->pool, ncaptures); + r->captures = ngx_palloc(r->pool, ncaptures * sizeof(int)); if (r->captures == NULL) { return NGX_ERROR; } |