Commit 1267b235 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] null-terminate sb->s_id

strncpy() may not null-terminate the destination.
parent b0887c1c
......@@ -636,7 +636,7 @@ struct super_block *get_sb_bdev(struct file_system_type *fs_type,
char b[BDEVNAME_SIZE];
s->s_flags = flags;
strncpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
s->s_old_blocksize = block_size(bdev);
sb_set_blocksize(s, s->s_old_blocksize);
error = fill_super(s, data, flags & MS_VERBOSE ? 1 : 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment