]> git.sur5r.net Git - openldap/commitdiff
ITS#7027 fix bugs in prev commit
authorHoward Chu <hyc@openldap.org>
Tue, 22 Jul 2014 02:34:31 +0000 (19:34 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 22 Jul 2014 22:33:46 +0000 (17:33 -0500)
libraries/libldap/dnssrv.c

index 6d1bfa8e3c2b05ca5ed0ebebc00c3a30086bca95..de849e30d5b01ae855853c79e88fb06d7aea1137 100644 (file)
@@ -323,7 +323,7 @@ int ldap_domain2hostlist(
                    goto out;
                }
                hostent_head[hostent_count].priority=priority;
-               hostent_head[hostent_count].weight=priority;
+               hostent_head[hostent_count].weight=weight;
                hostent_head[hostent_count].port=port;
                strncpy(hostent_head[hostent_count].hostname, host,255);
                hostent_count=hostent_count+1;
@@ -336,7 +336,7 @@ add_size:;
 
     for(i=0; i<hostent_count; i++){
        int buflen;
-        buflen = strlen(hostent_head[i].hostname) + STRLENOF(":65355" );
+        buflen = strlen(hostent_head[i].hostname) + STRLENOF(":65535 ");
         hostlist = (char *) LDAP_REALLOC(hostlist, cur+buflen+1);
         if (hostlist == NULL) {
             rc = LDAP_NO_MEMORY;