The call to ngx_sock_ntop() in ngx_connection_local_sockaddr() might be
performed with the uninitialized "len" variable. The fix is to initialize
variable to the size of corresponding socket address type.
The issue was introduced in commit
05ba5bce31e0.
#if (NGX_HAVE_INET6)
case AF_INET6:
sin6 = (struct sockaddr_in6 *) c->local_sockaddr;
+ len = sizeof(struct sockaddr_in6);
for (addr = 0, i = 0; addr == 0 && i < 16; i++) {
addr |= sin6->sin6_addr.s6_addr[i];
default: /* AF_INET */
sin = (struct sockaddr_in *) c->local_sockaddr;
+ len = sizeof(struct sockaddr_in);
addr = sin->sin_addr.s_addr;
break;
}