Blame SOURCES/autofs-5.1.2-fix-argc-off-by-one-in-mount_autofs_c.patch

304803
autofs-5.1.2 - fix argc off by one in mount_autofs.c
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
The mount_autofs.c module incorrectly calculates the number of
304803
arguments to its map.
304803
304803
Signed-off-by: Ian Kent <raven@themaw.net>
304803
---
304803
 CHANGELOG              |    1 +
304803
 modules/mount_autofs.c |    8 ++++----
304803
 2 files changed, 5 insertions(+), 4 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -220,6 +220,7 @@
304803
 - update and add README for old autofs schema.
304803
 - fix short memory allocation in lookup_amd_instance().
304803
 - fix count_mounts() function.
304803
+- fix argc off by one in mount_autofs.c.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/modules/mount_autofs.c
304803
+++ autofs-5.0.7/modules/mount_autofs.c
304803
@@ -179,11 +179,11 @@ int mount_mount(struct autofs_point *ap,
304803
 
304803
 	if (options) {
304803
 		char *t = options;
304803
-		do {
304803
+		while ((t = strchr(t, ',')) != NULL) {
304803
 			argc++;
304803
 			if (*t == ',')
304803
 				t++;
304803
-		} while ((t = strchr(t, ',')) != NULL);
304803
+		}
304803
 	}
304803
 	argv = (const char **) alloca((argc + 1) * sizeof(char *));
304803
 
304803
@@ -235,13 +235,13 @@ int mount_mount(struct autofs_point *ap,
304803
 
304803
 	if (options) {
304803
 		p = options;
304803
-		do {
304803
+		while ((p = strchr(p, ',')) != NULL) {
304803
 			if (*p == ',') {
304803
 				*p = '\0';
304803
 				p++;
304803
 			}
304803
 			argv[argc++] = p;
304803
-		} while ((p = strchr(p, ',')) != NULL);
304803
+		}
304803
 	}
304803
 	argv[argc] = NULL;
304803