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

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