This is meant to be initialised to the size of the buffer.
authorAndrew Bartlett <abartlet@samba.org>
Tue, 22 Apr 2003 15:50:15 +0000 (15:50 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 22 Apr 2003 15:50:15 +0000 (15:50 +0000)
(This used to be commit ca489db7d3d4713401da3627b563af3cbef82c58)

source3/passdb/pdb_ldap.c

index 741a89da143b3d40df963b4aff2ff5d68639e0cb..8a2378f91b281fef28896fe2b931489ef009764e 100644 (file)
@@ -443,7 +443,7 @@ static int ldapsam_open(struct ldapsam_privates *ldap_state)
 
        if ((ldap_state->ldap_struct != NULL) && ((ldap_state->last_ping + LDAPSAM_DONT_PING_TIME) < time(NULL))) {
                struct sockaddr_un addr;
-               socklen_t len;
+               socklen_t len = sizeof(addr);
                int sd;
                if (ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_DESC, &sd) == 0 &&
                    getpeername(sd, (struct sockaddr *) &addr, &len) < 0) {