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

603f99
autofs-5.1.4 - dont use array for path when not necessary
603f99
603f99
From: Ian Kent <raven@themaw.net>
603f99
603f99
In parse_amd.c:do_link_mount() a character array is used to construct
603f99
a path when a pointer to the relevant amd entry field is sufficient.
603f99
603f99
Signed-off-by: Ian Kent <raven@themaw.net>
603f99
---
603f99
 CHANGELOG           |    1 +
603f99
 modules/parse_amd.c |    6 +++---
603f99
 2 files changed, 4 insertions(+), 3 deletions(-)
603f99
603f99
--- autofs-5.0.7.orig/CHANGELOG
603f99
+++ autofs-5.0.7/CHANGELOG
603f99
@@ -291,6 +291,7 @@
603f99
 - serialize calls to open_xxxx() functions.
603f99
 - fix use after free in do_master_list_reset().
603f99
 - fix deadlock in dumpmaps.
603f99
+- dont use array for path when not necessary.
603f99
 
603f99
 25/07/2012 autofs-5.0.7
603f99
 =======================
603f99
--- autofs-5.0.7.orig/modules/parse_amd.c
603f99
+++ autofs-5.0.7/modules/parse_amd.c
603f99
@@ -969,8 +969,8 @@ static int do_auto_mount(struct autofs_p
603f99
 static int do_link_mount(struct autofs_point *ap, const char *name,
603f99
 			 struct amd_entry *entry, unsigned int flags)
603f99
 {
603f99
-	char target[PATH_MAX + 1];
603f99
 	const char *opts = (entry->opts && *entry->opts) ? entry->opts : NULL;
603f99
+	char *target;
603f99
 	int ret;
603f99
 
603f99
 	if (entry->sublink) {
603f99
@@ -979,14 +979,14 @@ static int do_link_mount(struct autofs_p
603f99
 			     "error: sublink option length is too long");
603f99
 			return 0;
603f99
 		}
603f99
-		strcpy(target, entry->sublink);
603f99
+		target = entry->sublink;
603f99
 	} else {
603f99
 		if (strlen(entry->fs) > PATH_MAX) {
603f99
 			error(ap->logopt, MODPREFIX
603f99
 			     "error: fs option length is too long");
603f99
 			return 0;
603f99
 		}
603f99
-		strcpy(target, entry->fs);
603f99
+		target = entry->fs;
603f99
 	}
603f99
 
603f99
 	if (!(flags & CONF_AUTOFS_USE_LOFS))