Blob Blame History Raw
diff -Nurp autofs-5.0.2.orig/lib/master_tok.l autofs-5.0.2/lib/master_tok.l
--- autofs-5.0.2.orig/lib/master_tok.l	2007-11-20 15:37:48.000000000 +0900
+++ autofs-5.0.2/lib/master_tok.l	2007-11-20 15:38:21.000000000 +0900
@@ -108,7 +108,8 @@ AT_DC		([dD][[cC])
 AT_O		([oO])
 AT_C		([cC])
 DNATTRSTR	{AT_CN}|{AT_NMN}|{AT_AMN}|{AT_OU}|{AT_DC}|{AT_O}|{AT_C}
-DNNAMESTR	([[:alnum:]_.\-]+)
+DNNAMESTR1	([[:alnum:]_.\- ]+)
+DNNAMESTR2	([[:alnum:]_.\-]+)
 
 INTMAP		(-hosts|-null)
 MULTI		((multi)(,(sun|hesiod))?(:{OPTWS}|{WS}))
@@ -281,7 +282,12 @@ OPTTOUT		(-t{OPTWS}|-t{OPTWS}={OPTWS}|--
 		return EQUAL;
 	}
 
-	{DNNAMESTR} {
+	{DNNAMESTR1}/"," {
+		strcpy(master_lval.strtype, master_text);
+		return DNNAME;
+	}
+
+	{DNNAMESTR2} {
 		strcpy(master_lval.strtype, master_text);
 		return DNNAME;
 	}
@@ -378,7 +384,13 @@ void master_set_scan_buffer(const char *
 {
 	line = buffer;
 	line_pos = &line[0];
-	line_lim = line + strlen(buffer);
+	/*
+	 * Ensure buffer is 1 greater than string and is zeroed before
+	 * the parse so we can fit the extra NULL which allows us to
+	 * explicitly match an end of line within the buffer (ie. the
+	 * need for 2 NULLS when parsing in memeory buffers).
+	 */
+	line_lim = line + strlen(buffer) + 1;
 }
 
 #define min(a,b) (((a) < (b)) ? (a) : (b))
diff -Nurp autofs-5.0.2.orig/modules/lookup_file.c autofs-5.0.2/modules/lookup_file.c
--- autofs-5.0.2.orig/modules/lookup_file.c	2007-11-20 15:37:48.000000000 +0900
+++ autofs-5.0.2/modules/lookup_file.c	2007-11-20 15:38:18.000000000 +0900
@@ -479,7 +479,7 @@ int lookup_read_master(struct master *ma
 
 			master->name = save_name;
 		} else {
-			blen = path_len + 1 + ent_len + 1;
+			blen = path_len + 1 + ent_len + 2;
 			buffer = malloc(blen);
 			if (!buffer) {
 				error(logopt,
diff -Nurp autofs-5.0.2.orig/modules/lookup_ldap.c autofs-5.0.2/modules/lookup_ldap.c
--- autofs-5.0.2.orig/modules/lookup_ldap.c	2007-11-20 15:37:48.000000000 +0900
+++ autofs-5.0.2/modules/lookup_ldap.c	2007-11-20 15:38:18.000000000 +0900
@@ -1368,7 +1368,7 @@ int lookup_read_master(struct master *ma
 			goto next;
 		}
 
-		blen = strlen(*keyValue) + 1 + strlen(*values) + 1;
+		blen = strlen(*keyValue) + 1 + strlen(*values) + 2;
 		if (blen > PARSE_MAX_BUF) {
 			error(logopt, MODPREFIX "map entry too long");
 			ldap_value_free(values);
diff -Nurp autofs-5.0.2.orig/modules/lookup_nisplus.c autofs-5.0.2/modules/lookup_nisplus.c
--- autofs-5.0.2.orig/modules/lookup_nisplus.c	2007-11-20 15:37:48.000000000 +0900
+++ autofs-5.0.2/modules/lookup_nisplus.c	2007-11-20 15:38:18.000000000 +0900
@@ -90,7 +90,7 @@ int lookup_read_master(struct master *ma
 	char *path, *ent;
 	char *buffer;
 	char buf[MAX_ERR_BUF];
-	int cur_state;
+	int cur_state, len;
 
 	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
 	tablename = alloca(strlen(ctxt->mapname) + strlen(ctxt->domainname) + 20);
@@ -138,11 +138,13 @@ int lookup_read_master(struct master *ma
 
 		ent = ENTRY_VAL(this, 1);
 
-		buffer = malloc(ENTRY_LEN(this, 0) + 1 + ENTRY_LEN(this, 1) + 1);
+		len = ENTRY_LEN(this, 0) + 1 + ENTRY_LEN(this, 1) + 2;
+		buffer = malloc(len);
 		if (!buffer) {
 			logerr(MODPREFIX "could not malloc parse buffer");
 			continue;
 		}
+		memset(buffer, 0, len);
 
 		strcat(buffer, path);
 		strcat(buffer, " ");
diff -Nurp autofs-5.0.2.orig/modules/lookup_yp.c autofs-5.0.2/modules/lookup_yp.c
--- autofs-5.0.2.orig/modules/lookup_yp.c	2007-11-20 15:37:48.000000000 +0900
+++ autofs-5.0.2/modules/lookup_yp.c	2007-11-20 15:38:18.000000000 +0900
@@ -178,7 +178,7 @@ int yp_all_master_callback(int status, c
 	*(ypkey + ypkeylen) = '\0';
 	*(val + vallen) = '\0';
 
-	len = ypkeylen + 1 + vallen + 1;
+	len = ypkeylen + 1 + vallen + 2;
 
 	buffer = alloca(len);
 	if (!buffer) {