fat: Fix bug in enforcing Long File Name length.
PATCH 2/2 fat: Fix bug in enforcing Long File Name length.
Since '*outlen' is initialized to zero,it is currently possible to create a f ilename of length (FAT_LFN_LEN +1) when utf8 is not enabled.To enforce the FA T_LFN_LEN limit, we must perform one less iteration.
--- fs/fat/namei_vfat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/fat/namei_vfat.c +1 -1
@@ -522,7 +522,7 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, op = &outname[*outlen *sizeof (wchar_t)]; }else {for (i =0 , ip = name, op = outname, *outlen =0 ; - i < len && *outlen <=FAT_LFN_LEN ; + i < len && *outlen <FAT_LFN_LEN ; *outlen +=1 ) {if (escape && (*ip ==':' )) {if (i > len -5 )
Signature · 1 line
1.7.5.4
Quoted 1 line · Namjae Jeon
Since '*outlen' is initialized to zero,it is currently possible to create a f ilename of length (
FAT_LFN_LEN+1) when utf8 is not enabled.To enforce the FAT_LFN_LENlimit, we must perform one less iteration.
Quoted 19 lines
Signed-off-by Namjae Jeon <[email protected]>Signed-off-by Ravishankar N <[email protected]>--- fs/fat/namei_vfat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)fs/fat/namei_vfat.c +1
-1@@ -522,7 +522,7 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, op = &outname[*outlen *sizeof (wchar_t)]; }else {for (i =0 , ip = name, op = outname, *outlen =0 ; - i < len && *outlen <=FAT_LFN_LEN ; + i < len && *outlen <FAT_LFN_LEN ; *outlen +=1 ) {if (escape && (*ip ==':' )) {if (i > len -5 )
Signature · 1 line
OGAWA Hirofumi <[email protected]>
OGAWA Hirofumi
maintainerQuoted 8 lines · OGAWA Hirofumi
Quoted 4 lines · Namjae Jeon
Since '*outlen' is initialized to zero,it is currently possible to
create a f ilename of length (FAT_LFN_LEN+1) when utf8 is not enabled.To enforce the FAT_LFN_LENlimit, we must perform one less iteration.Acked-by OGAWA Hirofumi <[email protected]>
Please forward this too.
Quoted 19 lines
Quoted 19 lines
Signed-off-by Namjae Jeon <[email protected]>Signed-off-by Ravishankar N <[email protected]>--- fs/fat/namei_vfat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)fs/fat/namei_vfat.c +1
-1@@ -522,7 +522,7 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, op = &outname[*outlen *sizeof (wchar_t)]; }else {for (i =0 , ip = name, op = outname, *outlen =0 ; - i < len && *outlen <=FAT_LFN_LEN ; + i < len && *outlen <FAT_LFN_LEN ; *outlen +=1 ) {if (escape && (*ip ==':' )) {if (i > len -5 )
Signature · 1 line
OGAWA Hirofumi <[email protected]>
Hi. Andrew.
Would you plz check this patch also ?
Thanks.
2012/3/4 OGAWA Hirofumi <[email protected]>:
Quoted 28 lines
Quoted 1 line · Namjae Jeon
Since '*outlen' is initialized to zero,it is currently possible to create a f ilename of length (
FAT_LFN_LEN+1) when utf8 is not enabled.To enforce the FAT_LFN_LENlimit, we must perform one less iteration.Acked-by OGAWA Hirofumi <[email protected]>Quoted 11 lines
Signed-off-by Namjae Jeon <[email protected]>Signed-off-by Ravishankar N <[email protected]>---
fs/fat/namei_vfat.c | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)fs/fat/namei_vfat.c +0
-0fs/fat/namei_vfat.c xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, · line 528
Quoted 8 lines
fs/fat/namei_vfat.c +1
-1@@ -522,7 +522,7 @@ xlate_to_uni(const unsigned char *name, int len, unsigned char *outname, op = &outname[*outlen * sizeof(wchar_t)]; } else { for (i = 0, ip = name, op = outname, *outlen = 0; - i < len && *outlen <= FAT_LFN_LEN; + i < len && *outlen < FAT_LFN_LEN; *outlen += 1) { if (escape && (*ip == ':')) { if (i > len - 5)--
OGAWA Hirofumi <[email protected]>