[Parted-commits] GNU Parted Official Repository: Changes to 'master'
Jim Meyering
meyering at alioth.debian.org
Fri Feb 13 11:15:15 UTC 2009
libparted/arch/linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit e94d23fb1e226beaf3ce02fee9c2f69eb5636674
Author: Jim Meyering <meyering at redhat.com>
Date: Fri Feb 13 12:08:13 2009 +0100
don't segfault on a device-mapper device with no target
* libparted/arch/linux.c (_dm_maptype): Don't dereference NULL
for a device-mapper device with no target. Use the string
"NO-TARGET" instead. Reported by Mike Hwang in
http://thread.gmane.org/gmane.comp.gnu.parted.devel/2432
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index da812d5..4a8c9e7 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -348,7 +348,7 @@ _dm_maptype (PedDevice *dev)
next = dm_get_next_target(dmt, NULL, &start, &length,
&target_type, ¶ms);
- arch_specific->dmtype = strdup(target_type);
+ arch_specific->dmtype = strdup(target_type ? target_type : "NO-TARGET");
if (arch_specific->dmtype == NULL)
goto bad;
r = 0;
More information about the Parted-commits
mailing list