]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super1.c
super1: Fix potential buffer overflows when copying cluster_name
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 7 Mar 2016 19:50:06 +0000 (14:50 -0500)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 9 Mar 2016 16:35:34 +0000 (11:35 -0500)
commit4b3eb4d2c5fd4c8eb3ad31fa494d243a886a9702
tree1f0e943491b6694c617296f4906f5fe62615045a
parentcc5083d114c4c88bc9477c2773b4b2426c4621e7
super1: Fix potential buffer overflows when copying cluster_name

cmap_get_string() used to retrieve cluster_name does not restrict it's
size. To prevent buffer overflows use the size of the destination
buffer, not strlen() of the source, and null terminate the copied
string.

Fixes: 0aa2f15b ("mdadm: add the ability to change cluster name)"
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
super1.c