From: Fabian Frederick Date: Wed, 4 Jun 2014 23:06:07 +0000 (-0700) Subject: fs/ocfs2/super.c: use OCFS2_MAX_VOL_LABEL_LEN and strlcpy X-Git-Tag: android-x86-4.4-r2~1023^2~16^2~250 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=69201bb1132718f45078ba6454093f5e220c0350;p=android-x86%2Fkernel.git fs/ocfs2/super.c: use OCFS2_MAX_VOL_LABEL_LEN and strlcpy Replace strncpy(size 63) by defined value. Signed-off-by: Fabian Frederick Cc: Joel Becker Cc: Mark Fasheh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 9027729e3992..c7a89cea5c5d 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -2292,8 +2292,8 @@ static int ocfs2_initialize_super(struct super_block *sb, goto bail; } - strncpy(osb->vol_label, di->id2.i_super.s_label, 63); - osb->vol_label[63] = '\0'; + strlcpy(osb->vol_label, di->id2.i_super.s_label, + OCFS2_MAX_VOL_LABEL_LEN); osb->root_blkno = le64_to_cpu(di->id2.i_super.s_root_blkno); osb->system_dir_blkno = le64_to_cpu(di->id2.i_super.s_system_dir_blkno); osb->first_cluster_group_blkno =