Hi,

ped_disk_set_partition_geom() in disk.c calls ped_geometry_init() and
doesn't check the return value. This way the new geom will be assigned to
the partition even if it's not valid.
Attached is a patch to fix this.

grtz,

Bart

-- 
--- plors
--- parted-1.7.1old/libparted/disk.c	2006-07-29 21:07:47.000000000 +0200
+++ parted-1.7.1/libparted/disk.c	2006-07-29 21:08:24.000000000 +0200
@@ -1913,7 +1913,8 @@
 	PED_ASSERT (part->disk == disk, return 0);
 
 	old_geom = part->geom;
-	ped_geometry_init (&new_geom, part->geom.dev, start, end - start + 1); 
+	if( ! ped_geometry_init (&new_geom, part->geom.dev, start, end - start + 1) )
+		goto error ;
 
 	_disk_push_update_mode (disk);
 
_______________________________________________
bug-parted mailing list
bug-parted@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-parted

Reply via email to