]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - util.c
Fix possible bug with bitmap space allocation with v1.0 metadata
[thirdparty/mdadm.git] / util.c
diff --git a/util.c b/util.c
index dd8b176ab43558f6f47fc15520bcc8cde206ced8..1ba236b781c1ad4dc86563e54edea9133aeffcdb 100644 (file)
--- a/util.c
+++ b/util.c
@@ -730,7 +730,7 @@ struct supertype *super_by_fd(int fd)
        int minor;
        struct supertype *st = NULL;
        struct mdinfo *sra;
-       char *verstr = NULL;
+       char *verstr;
        char version[20];
        int i;
 
@@ -739,11 +739,13 @@ struct supertype *super_by_fd(int fd)
        if (sra) {
                vers = sra->array.major_version;
                minor = sra->array.minor_version;
+               verstr = sra->text_version;
        } else {
                if (ioctl(fd, GET_ARRAY_INFO, &array))
                        array.major_version = array.minor_version = 0;
                vers = array.major_version;
                minor = array.minor_version;
+               verstr = "";
        }
 
        if (vers != -1) {