Whamcloud - gitweb
LU-2800 autoconf: remove bio_endio args test
[fs/lustre-release.git] / lustre / utils / mount_lustre.c
index c8fe8a6..20abe44 100644 (file)
@@ -324,7 +324,12 @@ static int clear_update_ondisk(char *source, struct lustre_disk_data *ldd)
        memset(&mkop, 0, sizeof(mkop));
        mkop.mo_ldd = *ldd;
        mkop.mo_ldd.ldd_flags &= ~LDD_F_UPDATE;
-       strcpy(mkop.mo_device, source);
+       if (strlen(source) > sizeof(mkop.mo_device)-1) {
+               fatal();
+               fprintf(stderr, "Device name too long: %s\n", source);
+               return -E2BIG;
+       }
+       strncpy(mkop.mo_device, source, sizeof(mkop.mo_device));
 
        ret = osd_prepare_lustre(&mkop,
                        default_mountopts, sizeof(default_mountopts),