]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs/ocfs2/super.c: use OCFS2_MAX_VOL_LABEL_LEN and strlcpy
authorFabian Frederick <fabf@skynet.be>
Thu, 22 May 2014 00:42:30 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:42:30 +0000 (10:42 +1000)
Replace strncpy(size 63) by defined value.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/ocfs2/super.c

index 9027729e39926d4be0a70b5e09580a3ca98ad3ff..c7a89cea5c5dc3d0974aa67e5f53372b500c4f67 100644 (file)
@@ -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 =