From 141ca8cd7b768ddefa1bfaa563cbef4337e32b7c Mon Sep 17 00:00:00 2001 From: Martin Poole Date: Wed, 29 Jul 2009 13:20:45 +0000 Subject: Fix a segfault in the mdraid code -- see rh#507782 for more info Signed-off-by: Richard Hughes --- diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c index 69ba026..7b47431 100644 --- a/hald/linux/blockdev.c +++ b/hald/linux/blockdev.c @@ -878,7 +878,7 @@ error: } -void + hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const gchar *device_file, gboolean is_partition, HalDevice *parent, void *end_token) { @@ -893,6 +893,7 @@ hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const gchar *device_f gboolean is_md_device; gboolean is_cciss_device; int md_number; + char tc; is_device_mapper = FALSE; is_fakevolume = FALSE; @@ -911,7 +912,7 @@ hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const gchar *device_f HAL_INFO (("Handling %s as fakevolume - sysfs_path_real=%s", device_file, sysfs_path_real)); is_fakevolume = TRUE; sysfs_path_real = hal_util_get_parent_path (sysfs_path); - } else if (sscanf (hal_util_get_last_element (sysfs_path), "md%d", &md_number) == 1) { + } else if (sscanf (hal_util_get_last_element (sysfs_path), "md%d%c", &md_number, &tc) == 1) { HAL_INFO (("Handling %s as MD device", device_file)); is_md_device = TRUE; sysfs_path_real = g_strdup (sysfs_path); -- cgit v0.8.2