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

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