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.

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>
This commit is contained in:
Chao Yu 2015-11-30 10:41:07 +00:00 committed by Jaegeuk Kim
parent 1540a28ca9
commit c9274cb646

View File

@ -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;