mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
f2fs: replace deprecated strcpy with strscpy
strcpy is deprecated. Kernel docs recommend replacing strcpy with strscpy. The function strcpy() return value isn't used so there shouldn't be an issue replacing with the safer alternative strscpy. Signed-off-by: Daniel Yang <danielyangkang@gmail.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
acff9409dd
commit
789ca0eb47
|
|
@ -1172,7 +1172,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
|
|||
break;
|
||||
}
|
||||
|
||||
strcpy(ext[ext_cnt], name);
|
||||
ret = strscpy(ext[ext_cnt], name);
|
||||
if (ret < 0) {
|
||||
kfree(name);
|
||||
return ret;
|
||||
}
|
||||
F2FS_OPTION(sbi).compress_ext_cnt++;
|
||||
kfree(name);
|
||||
break;
|
||||
|
|
@ -1201,7 +1205,11 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
|
|||
break;
|
||||
}
|
||||
|
||||
strcpy(noext[noext_cnt], name);
|
||||
ret = strscpy(noext[noext_cnt], name);
|
||||
if (ret < 0) {
|
||||
kfree(name);
|
||||
return ret;
|
||||
}
|
||||
F2FS_OPTION(sbi).nocompress_ext_cnt++;
|
||||
kfree(name);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user