aboutsummaryrefslogtreecommitdiffstats
path: root/mkfs
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-11-30 10:41:07 +0000
committerSteve Kondik <steve@cyngn.com>2016-08-24 11:43:29 -0700
commit0f7742c05da1ae0162e59b37a64266ef4e6514d8 (patch)
treed36d8e6dd495c2fad0d2d1c7a5b4331863c2b96d /mkfs
parent3103a7e137aff11657dc6c77eed2e0606750e4f9 (diff)
downloadandroid_external_f2fs-tools-0f7742c05da1ae0162e59b37a64266ef4e6514d8.tar.gz
android_external_f2fs-tools-0f7742c05da1ae0162e59b37a64266ef4e6514d8.tar.bz2
android_external_f2fs-tools-0f7742c05da1ae0162e59b37a64266ef4e6514d8.zip
mkfs.f2fs: skip extension name that is too long
The length of extension name has a limit of 8 bytes. If an extension exceeds the limitation, it will not be added to the extension_list. Change-Id: I67765b42ff81a0e33b10aae9efa640f772187e9d Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'mkfs')
-rw-r--r--mkfs/f2fs_format.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index a29d7ef..212df60 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -157,8 +157,13 @@ static void configure_extension_list(void)
ue = strtok(ext_str, ", ");
while (ue != NULL) {
name_len = strlen(ue);
+ if (name_len >= 8) {
+ MSG(0, "\tWarn: Extension name (%s) is too long\n", ue);
+ goto next;
+ }
if (!is_extension_exist(ue))
memcpy(sb.extension_list[i++], ue, name_len);
+next:
ue = strtok(NULL, ", ");
if (i >= F2FS_MAX_EXTENSION)
break;