mirror of
https://github.com/nginx/nginx.git
synced 2026-08-27 04:07:18 +00:00
fix segfault if no rules are defined, introduced in r3279
This commit is contained in:
parent
cc65b0879b
commit
89601c0f10
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue