Blame SOURCES/autofs-5.0.7-add-null-check-in-parse_server_string.patch

304803
autofs-5.0.7 - add null check in parse_server_string()
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
Add an error check for the case there's no ':' server name delimiter in
304803
parse_server_string().
304803
---
304803
 modules/lookup_ldap.c |    5 +++++
304803
 1 file changed, 5 insertions(+)
304803
304803
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
304803
index 17cbe9a..a59de92 100644
304803
--- a/modules/lookup_ldap.c
304803
+++ b/modules/lookup_ldap.c
304803
@@ -1212,6 +1212,11 @@ static int parse_server_string(unsigned logopt, const char *url, struct lookup_c
304803
 		/* Isolate the server. Include the port spec */
304803
 		if (*ptr != '[')
304803
 			q = strchr(ptr, ':');
304803
+			if (!q) {
304803
+				crit(logopt, MODPREFIX
304803
+				     "LDAP server name not found in %s", ptr);
304803
+				return 0;
304803
+			}
304803
 		else {
304803
 			q = ++ptr;
304803
 			while (*q == ':' || isxdigit(*q))