]> git.sur5r.net Git - openldap/commitdiff
fix from jon@symas.com - inet_ntoa on uninitialized sockaddr
authorHoward Chu <hyc@openldap.org>
Mon, 17 Dec 2001 22:46:59 +0000 (22:46 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 17 Dec 2001 22:46:59 +0000 (22:46 +0000)
servers/slapd/daemon.c

index 4b5ab5f973e560e5502268f5b5b66eb1a55a7b71..911db57cd54f68b91af3add7284a032b9244bfbe 100644 (file)
@@ -733,11 +733,10 @@ static Listener * slap_open_listener(
                inet_ntop( AF_INET, &((struct sockaddr_in *)*sal)->sin_addr,
                           addr, sizeof(addr) );
                s = addr;
-               port = ((struct sockaddr_in *)*sal) ->sin_port;
 #else
-               s = inet_ntoa( l.sl_addr.sin_addr );
-               port = l.sl_addr.sin_port;
+               s = inet_ntoa( ((struct sockaddr_in *) *sal)->sin_addr );
 #endif
+               port = ((struct sockaddr_in *)*sal) ->sin_port;
                l.sl_name = ch_malloc( sizeof("IP=255.255.255.255:65535") );
                sprintf( l.sl_name, "IP=%s:%d",
                         s != NULL ? s : "unknown" , port );