ba8184
Date: Sun, 12 Dec 2004 14:25:09 +0100
ba8184
From: Christoph Hellwig <hch@lst.de>
ba8184
To: submit@bugs.debian.org
ba8184
ba8184
Package: udftools
ba8184
Version: 1.0.0b3-6
ba8184
ba8184
mkduffs crashes with a segmentation fault when trying to create a
ba8184
filesystem on big-endian systems.  e.g. mkudffs /dev/sda4 on my
ba8184
PowerMac.
ba8184
ba8184
udffstools from CVS on sf.net is fine, and I've extracted the actual
ba8184
fix:
ba8184
ba8184
ba8184
diff -uNr -Xdontdiff -p udftools-1.0.0b3/mkudffs/mkudffs.c udftools/mkudffs/mkudffs.c
ba8184
--- udftools-1.0.0b3/mkudffs/mkudffs.c	2004-02-23 04:35:33.000000000 +0100
ba8184
+++ udftools/mkudffs/mkudffs.c	2004-03-02 03:09:39.000000000 +0100
ba8184
@@ -250,14 +250,14 @@ void split_space(struct udf_disc *disc)
ba8184
 	if (size % offsets[PSPACE_SIZE])
ba8184
 		size -= (size % offsets[PSPACE_SIZE]);
ba8184
 	set_extent(disc, PSPACE, start, size);
ba8184
-	for (i=0; i<disc->udf_lvd[0]->numPartitionMaps; i++)
ba8184
+	for (i=0; i<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); i++)
ba8184
 	{
ba8184
 		if (i == 1)
ba8184
 			disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(0xFFFFFFFF);
ba8184
 		else
ba8184
 			disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(size);
ba8184
 	}
ba8184
-	for (j=0; j<disc->udf_lvd[0]->numPartitionMaps; j++)
ba8184
+	for (j=0; j<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); j++)
ba8184
 	{
ba8184
 		if (j == 1)
ba8184
 			disc->udf_lvid->sizeTable[i+j] = cpu_to_le32(0xFFFFFFFF);
ba8184