From 163d414c9f3cdeaeca3f07bb026a726421eec048 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Fri, 11 Jul 2003 14:35:49 +0000 Subject: [PATCH] Can't use vol->dev->d_name before it is allocated! D'oh! Thanks to Szaka for reporting this. (Logical change 1.152) --- ntfsprogs/mkntfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c index 9df41180..2f2571fd 100644 --- a/ntfsprogs/mkntfs.c +++ b/ntfsprogs/mkntfs.c @@ -123,6 +123,7 @@ runlist *rl = NULL, *rl_mft = NULL, *rl_mft_bmp = NULL, *rl_mftmirr = NULL; runlist *rl_logfile = NULL, *rl_boot = NULL, *rl_bad = NULL, *rl_index; INDEX_ALLOCATION *index_block = NULL; ntfs_volume *vol; +char *dev_name; struct { int sector_size; /* -s, in bytes, power of 2, default is @@ -351,7 +352,7 @@ void parse_options(int argc, char *argv[]) } if (optind == argc) usage(); - vol->dev->d_name = argv[optind++]; + dev_name = argv[optind++]; if (optind < argc) { u = strtoul(argv[optind++], &s, 0); if (*s || !u || (u >= ULONG_MAX && errno == ERANGE)) @@ -2553,7 +2554,7 @@ int main(int argc, char **argv) * Allocate and initialize an ntfs device structure and attach it to * the volume. */ - if (!(vol->dev = ntfs_device_alloc(vol->dev->d_name, 0, + if (!(vol->dev = ntfs_device_alloc(dev_name, 0, &ntfs_device_disk_io_ops, NULL))) err_exit("Could not allocate memory for internal buffer.\n"); /* Open the device for reading or reading and writing. */