mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 18:19:43 +00:00
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:
parent
1540a28ca9
commit
c9274cb646
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user