From 73184b3cc377c33f1794490c5a4c0ac39f2f22f4 Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Mon, 21 Jul 2014 19:34:31 -0700
Subject: [PATCH] ITS#7027 fix bugs in prev commit

---
 libraries/libldap/dnssrv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libraries/libldap/dnssrv.c b/libraries/libldap/dnssrv.c
index 6d1bfa8e3c..de849e30d5 100644
--- a/libraries/libldap/dnssrv.c
+++ b/libraries/libldap/dnssrv.c
@@ -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;
-- 
GitLab