To avoid overflow, set namelen parameter of convert_encrypted_name as
unsigned int. convert_encrypted_name() will check if namelen exceeds the
limitation.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
u64 i_blocks = le64_to_cpu(node_blk->i.i_blocks);
int ofs;
unsigned char *en;
- int namelen;
+ u32 namelen;
unsigned int idx = 0;
int need_fix = 0;
int ret;
return cp - dst;
}
-int convert_encrypted_name(unsigned char *name, int len,
+int convert_encrypted_name(unsigned char *name, u32 len,
unsigned char *new, int enc_name)
{
if (!enc_name) {
{
int last_de = 0;
int next_idx = 0;
- int name_len;
+ u32 name_len;
unsigned int i;
int bit_offset;
unsigned char new[F2FS_NAME_LEN + 1];
struct child_info *);
int fsck_chk_meta(struct f2fs_sb_info *sbi);
int fsck_chk_curseg_info(struct f2fs_sb_info *);
-int convert_encrypted_name(unsigned char *, int, unsigned char *, int);
+int convert_encrypted_name(unsigned char *, u32, unsigned char *, int);
extern void update_free_segments(struct f2fs_sb_info *);
void print_cp_state(u32);
struct f2fs_xattr_entry *ent;
unsigned char en[F2FS_NAME_LEN + 1];
unsigned int i = 0;
- int namelen = le32_to_cpu(inode->i_namelen);
+ u32 namelen = le32_to_cpu(inode->i_namelen);
int enc_name = file_enc_name(inode);
int ofs = __get_extra_isize(inode);