diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-11-03 16:04:07 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-11-03 16:04:07 +0000 |
commit | 89601c0f100013c59f17d66a7b23633cc23f1501 (patch) | |
tree | 37a6e81bbe13016bdb31552ee914afb9cfef0855 /src | |
parent | cc65b0879be0508ca2c24faaeec1778943138599 (diff) | |
download | nginx-89601c0f100013c59f17d66a7b23633cc23f1501.tar.gz nginx-89601c0f100013c59f17d66a7b23633cc23f1501.zip |
fix segfault if no rules are defined, introduced in r3279
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_access_module.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_access_module.c b/src/http/modules/ngx_http_access_module.c index 90f33ca0d..c1e7718c0 100644 --- a/src/http/modules/ngx_http_access_module.c +++ b/src/http/modules/ngx_http_access_module.c @@ -113,7 +113,7 @@ ngx_http_access_handler(ngx_http_request_t *r) #if (NGX_HAVE_INET6) - if (r->connection->sockaddr->sa_family == AF_INET6) { + if (alcf->rules6 && r->connection->sockaddr->sa_family == AF_INET6) { u_char *p; in_addr_t addr; struct sockaddr_in6 *sin6; @@ -134,7 +134,7 @@ ngx_http_access_handler(ngx_http_request_t *r) #endif - if (r->connection->sockaddr->sa_family == AF_INET) { + if (alcf->rules && r->connection->sockaddr->sa_family == AF_INET) { sin = (struct sockaddr_in *) r->connection->sockaddr; return ngx_http_access_inet(r, alcf, sin->sin_addr.s_addr); } |