]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm: Specify enough length when write to buffer
authorXiao Ni <xni@redhat.com>
Fri, 17 Mar 2017 11:55:43 +0000 (19:55 +0800)
committerJes Sorensen <Jes.Sorensen@gmail.com>
Fri, 17 Mar 2017 19:58:16 +0000 (15:58 -0400)
commitff9239ee3177630d62c7a58408992af7a779763c
treedec7c058c0aca98e59d9a1a111b02600a9baa129
parent8268821b434d1308d083454fb681d80176cf352b
mdadm: Specify enough length when write to buffer

In Detail.c the buffer path in function Detail is defined as path[200],
in fact the max lenth of content which needs to write to the buffer is
287. Because the length of dname of struct dirent is 255.
During building it reports error:
error: ā€˜%sā€™ directive writing up to 255 bytes into a region of size 189
[-Werror=format-overflow=]

In function examine_super0 there is a buffer nb with length 5.
But it need to show a int type argument. The lenght of max
number of int is 10. So the buffer length should be 11.

In human_size function the length of buf is 30. During building
there is a error:
output between 20 and 47 bytes into a destination of size 30.
Change the length to 47.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Detail.c
super0.c
util.c