Blame SOURCES/autofs-5.1.4-dont-use-array-for-path-when-not-neccessary.patch

135b98
autofs-5.1.4 - dont use array for path when not necessary
135b98
135b98
From: Ian Kent <raven@themaw.net>
135b98
135b98
In parse_amd.c:do_link_mount() a character array is used to construct
135b98
a path when a pointer to the relevant amd entry field is sufficient.
135b98
135b98
Signed-off-by: Ian Kent <raven@themaw.net>
135b98
---
135b98
 CHANGELOG           |    1 +
135b98
 modules/parse_amd.c |    6 +++---
135b98
 2 files changed, 4 insertions(+), 3 deletions(-)
135b98
135b98
diff --git a/CHANGELOG b/CHANGELOG
135b98
index 0f30596f..13f01397 100644
135b98
--- a/CHANGELOG
135b98
+++ b/CHANGELOG
135b98
@@ -3,6 +3,7 @@ xx/xx/2018 autofs-5.1.5
135b98
 - fix directory create permission.
135b98
 - fix use after free in do_master_list_reset().
135b98
 - fix deadlock in dumpmaps.
135b98
+- dont use array for path when not necessary.
135b98
 
135b98
 19/12/2017 autofs-5.1.4
135b98
 - fix spec file url.
135b98
diff --git a/modules/parse_amd.c b/modules/parse_amd.c
135b98
index c4b3ef0b..2cce5417 100644
135b98
--- a/modules/parse_amd.c
135b98
+++ b/modules/parse_amd.c
135b98
@@ -967,8 +967,8 @@ static int do_auto_mount(struct autofs_point *ap, const char *name,
135b98
 static int do_link_mount(struct autofs_point *ap, const char *name,
135b98
 			 struct amd_entry *entry, unsigned int flags)
135b98
 {
135b98
-	char target[PATH_MAX + 1];
135b98
 	const char *opts = (entry->opts && *entry->opts) ? entry->opts : NULL;
135b98
+	char *target;
135b98
 	int ret;
135b98
 
135b98
 	if (entry->sublink) {
135b98
@@ -977,14 +977,14 @@ static int do_link_mount(struct autofs_point *ap, const char *name,
135b98
 			     "error: sublink option length is too long");
135b98
 			return 0;
135b98
 		}
135b98
-		strcpy(target, entry->sublink);
135b98
+		target = entry->sublink;
135b98
 	} else {
135b98
 		if (strlen(entry->fs) > PATH_MAX) {
135b98
 			error(ap->logopt, MODPREFIX
135b98
 			     "error: fs option length is too long");
135b98
 			return 0;
135b98
 		}
135b98
-		strcpy(target, entry->fs);
135b98
+		target = entry->fs;
135b98
 	}
135b98
 
135b98
 	if (!(flags & CONF_AUTOFS_USE_LOFS))