[syslinux:master] vfat: Fix mangling of directory names starting with ..

syslinux-bot for Rich Mahn rich at lat.com
Mon Apr 4 15:51:02 PDT 2011


Commit-ID:  da9c8bcfbb899975a8254e0a97945074c359ff19
Gitweb:     http://syslinux.zytor.com/commit/da9c8bcfbb899975a8254e0a97945074c359ff19
Author:     Rich Mahn <rich at lat.com>
AuthorDate: Mon, 4 Apr 2011 15:46:06 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Mon, 4 Apr 2011 15:46:06 -0700

vfat: Fix mangling of directory names starting with ..

We need to handle directory names starting with .. correctly.

Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 core/fs/fat/fat.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/fs/fat/fat.c b/core/fs/fat/fat.c
index c896b5e..d307926 100644
--- a/core/fs/fat/fat.c
+++ b/core/fs/fat/fat.c
@@ -254,8 +254,10 @@ static void vfat_mangle_name(char *dst, const char *src)
     while (1) {
         if (dst == p)
             break;
-		if (*(dst-1) == '/' && dst-1 == p) /* it's the '/' case */
-			break;
+	if (*(dst-1) == '/' && dst-1 == p) /* it's the '/' case */
+		break;
+	if (dst-2 == p && *(dst-2) == '.' && *(dst-1) == '.' )	/* the '..' case */
+		break;
         if ((*(dst-1) != '/') && (*(dst-1) != '.'))
             break;
 



More information about the Syslinux-commits mailing list