Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 260

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

diff --git a/lib/parse_subs.c b/lib/parse_subs.c
index ad19f34..3627f44 100644
--- a/lib/parse_subs.c
+++ b/lib/parse_subs.c
@@ -297,7 +297,8 @@ char *sanitize_path(const char *path, int origlen, unsigned int type, unsigned i
 		return NULL;
 	}
 
-	if (origlen > 1 && *(cp - 1) == '/')
+	/* Remove trailing / but watch out for a quoted / alone */
+	if (strlen(cp) > 1 && origlen > 1 && *(cp - 1) == '/')
 		*(cp - 1) = '\0';
 
 	return s_path;