[libmultipath] fix segfault on empty maps in dm_type()
authorChristophe Varoqui <root@xa-s05.(none)>
Mon, 3 Oct 2005 10:28:43 +0000 (12:28 +0200)
committerChristophe Varoqui <root@xa-s05.(none)>
Mon, 3 Oct 2005 10:28:43 +0000 (12:28 +0200)
Reported by Maxim Kozover

libmultipath/devmapper.c

index 7cd656f..b662b74 100644 (file)
@@ -278,7 +278,7 @@ dm_type(char * name, char * type)
        next = dm_get_next_target(dmt, next, &start, &length,
                                  &target_type, &params);
 
-       if (0 == strcmp(target_type, type))
+       if (target_type && !strcmp(target_type, type))
                r = 1;
 
 out: