]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm: Fix building errors
authorXiao Ni <xni@redhat.com>
Tue, 22 Jun 2021 15:15:55 +0000 (23:15 +0800)
committerJes Sorensen <jsorensen@fb.com>
Fri, 16 Jul 2021 14:27:17 +0000 (10:27 -0400)
In util.c, there is a building error:
'/md/metadata_version' directive writing 20 bytes into a
region of size between 0 and 255 [-Werror=format-overflow=]

In mapfile.c
It declares the fouth argument as 'int *' in map_update,
but in mdadm.h it's previously declared as an array 'int[4]'

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
mapfile.c
util.c

index 8d7acb3cc389ca0ce49c1dabb99bfe2782875993..6b2207dd0303922a9b1aab22ccbd9de1a3d2fdad 100644 (file)
--- a/mapfile.c
+++ b/mapfile.c
@@ -215,7 +215,7 @@ void map_free(struct map_ent *map)
 }
 
 int map_update(struct map_ent **mpp, char *devnm, char *metadata,
-              int *uuid, char *path)
+              int uuid[4], char *path)
 {
        struct map_ent *map, *mp;
        int rv;
diff --git a/util.c b/util.c
index 5879694758ad836afd722f298ce1fc73076fa4aa..cdf1da24f2d11456b49f880a87fe7be513d13735 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1543,7 +1543,7 @@ int open_container(int fd)
        /* 'fd' is a block device.  Find out if it is in use
         * by a container, and return an open fd on that container.
         */
-       char path[256];
+       char path[288];
        char *e;
        DIR *dir;
        struct dirent *de;