hal/hald/linux/volume_id volume_id.c,1.2,1.3

David Zeuthen david at pdx.freedesktop.org
Tue May 4 22:02:32 PDT 2004


Update of /cvs/hal/hal/hald/linux/volume_id
In directory pdx:/tmp/cvs-serv20480/hald/linux/volume_id

Modified Files:
	volume_id.c 
Log Message:
2004-05-05  Kay Sievers  <kay.sievers at vrfy.org>

	* hald/linux/volume_id/volume_id.c (probe_udf): fix for big-endian



Index: volume_id.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- a/volume_id.c	4 May 2004 21:56:47 -0000	1.2
+++ b/volume_id.c	5 May 2004 05:02:30 -0000	1.3
@@ -538,6 +538,8 @@
 	for (b = 0; b < 64; b++) {
 		vsd = (struct volume_structure_descriptor *)
 		      get_buffer(id, UDF_VSD_OFFSET + (b * bs), 0x800);
+		if (vsd == NULL)
+			return -1;
 
 		dbg("vsd: %c%c%c%c%c",
 		    vsd->id[0], vsd->id[1], vsd->id[2], vsd->id[3], vsd->id[4]);
@@ -555,21 +557,23 @@
 	/* read anchor volume descriptor */
 	vd = (struct volume_descriptor *) get_buffer(id, 256 * bs, 0x200);
 	if (vd == NULL)
-		goto found;
+		return -1;
 
 	type = le16_to_cpu(vd->tag.id);
 	if (type != 2) /* TAG_ID_AVDP */
 		goto found;
 
 	/* get desriptor list address and block count */
-	count = le16_to_cpu(vd->type.anchor.length) / bs;
-	loc = le16_to_cpu(vd->type.anchor.location);
+	count = le32_to_cpu(vd->type.anchor.length) / bs;
+	loc = le32_to_cpu(vd->type.anchor.location);
 	dbg("0x%x descriptors starting at logical secor 0x%x", count, loc);
 
 	/* pick the primary descriptor from the list */
 	for (b = 0; b < count; b++) {
 		vd = (struct volume_descriptor *)
 		     get_buffer(id, (loc + b) * bs, 0x200);
+		if (vd == NULL)
+			return -1;
 
 		type = le16_to_cpu(vd->tag.id);
 		dbg("descriptor type %i", type);





More information about the hal-commit mailing list