summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2020-10-30 12:46:05 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2020-10-30 12:46:05 +0000
commit51b611aa81d7ee01243b196abc34a0e2eabd293c (patch)
tree1df747b7dad09783fe10292d84e30129d79a01f1 /src
parent61eac6b579e27f3959c7048a17ac5a36b0c32002 (diff)
LDAP: fix taint-check in server list walk. Bug 2646
Diffstat (limited to 'src')
-rw-r--r--src/src/lookups/ldap.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c
index e2dbe5162..1674c9f1f 100644
--- a/src/src/lookups/ldap.c
+++ b/src/src/lookups/ldap.c
@@ -1091,9 +1091,7 @@ const uschar *p;
uschar *user = NULL;
uschar *password = NULL;
uschar *local_servers = NULL;
-uschar *server;
const uschar *list;
-uschar buffer[512];
while (isspace(*url)) url++;
@@ -1251,13 +1249,13 @@ if (!eldap_default_servers && !local_servers || p[3] != '/')
&defer_break, user, password, sizelimit, timelimit, tcplimit, dereference,
referrals);
-/* Loop through the default servers until OK or FAIL. Use local_servers list
- * if defined in the lookup, otherwise use the global default list */
-list = !local_servers ? eldap_default_servers : local_servers;
-while ((server = string_nextinlist(&list, &sep, buffer, sizeof(buffer))))
+/* Loop through the servers until OK or FAIL. Use local_servers list
+if defined in the lookup, otherwise use the global default list */
+
+list = local_servers ? local_servers : eldap_default_servers;
+for (uschar * server; server = string_nextinlist(&list, &sep, NULL, 0); )
{
- int rc;
- int port = 0;
+ int rc, port = 0;
uschar *colon = Ustrchr(server, ':');
if (colon)
{