mirror of
https://github.com/nginx/nginx.git
synced 2025-06-11 04:12:40 +08:00
fix segfaults introduced in r2549 and r2550
This commit is contained in:
parent
da404fcfe5
commit
000609ae76
@ -1380,9 +1380,9 @@ ngx_http_core_find_location(ngx_http_request_t *r)
|
|||||||
|
|
||||||
if ((*clcfp)->captures && r->captures == NULL) {
|
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) {
|
if (r->captures == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
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) {
|
if (r->captures == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user