[Parted-maintainers] Bug#586682: libparted: partitions created with ped_device_new_from_store() make libparted crash on _done()

Samuel Thibault sthibault at debian.org
Sun Feb 20 21:00:28 UTC 2011


Jérémie Koenig, le Mon 21 Jun 2010 18:04:38 +0200, a écrit :
> 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 <jk at 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

ping?

Samuel





More information about the Parted-maintainers mailing list