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