Package: libparted0debian1
Version: 2.2-5
Severity: normal
Tags: patch
User: j...@jk.fr.eu.org
Usertags: gsoc2010
User: debian-h...@lists.debian.org
Usertags: hurd

(^^^ hope this works, will fix it if not.)

Hello, thanks for maintaining parted.

On Hurd, libparted devices can be created directly from "store" objects
through the hurd-specific ped_device_new_from_store() function.

Such devices don't get registered into linked list and have a
non-initialized 'next' field. A later call to ped_device_destroy() will
make _device_unregister() mangle the mailing list as a result.
A crash will result the next time the list is used, for instance on exit
when destroying all devices.

For what it's worth, ped_device_new_from_store() is used for the
(preliminary) user-space partitions support in Hurd's libstore, which
will probably be needed for debian-installer.

The attached patch makes _device_unregister() do nothing if the device
was not found in the list.

-- 
Jeremie Koenig <j...@jk.fr.eu.org>
http://jk.fr.eu.org
Index: parted-2.2/libparted/device.c
===================================================================
--- parted-2.2.orig/libparted/device.c	2010-06-21 17:20:53.000000000 +0200
+++ parted-2.2/libparted/device.c	2010-06-21 17:21:01.000000000 +0200
@@ -73,6 +73,10 @@
 		if (walk == dev) break;
 	}
 
+	/* non-registered device */
+	if (walk == NULL)
+		return;
+
 	if (last)
 		last->next = dev->next;
 	else

Reply via email to