get_device_by_label.c: Apply fix from Erik Troan to support 16
character labels.
2000-10-24 <tytso@snap.thunk.org>
+ * get_device_by_label.c: Apply fix from Erik Troan to support 16
+ character labels.
+
* fsck.c (device_already_active): Add a special case check for MD
devices, so we don't try to check them in parallel with
other devices.
/* superblock is ext2 - now what is its label? */
memcpy(uuid, e2sb.s_uuid, sizeof(e2sb.s_uuid));
- *label = strdup(e2sb.s_volume_name);
+
+ *label = calloc(sizeof(e2sb.s_volume_name) + 1, 1);
+ memcpy(*label, e2sb.s_volume_name, sizeof(e2sb.s_volume_name));
return 0;
}