Skip to contentSkip to conversation

device-mapper ./WHATS_NEW dmsetup/dmsetup.c

PATCH [email protected] 1 participant 1 message Apr 27, 2007 Device mapper

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: [email protected] 2007-04-27 16:12:26

Modified files:
. : WHATS_NEW
dmsetup : dmsetup.c

Log message:
Fix segfault in 'dmsetup status' without --showkeys against crypt target. [nec]

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.177&r2=1.178
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/dmsetup/dmsetup.c.diff?cvsroot=dm&r1=1.88&r2=1.89

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 1.02.19 -
 ====================================
+  Fix segfault in 'dmsetup status' without --showkeys against crypt target.
   Deal with some more compiler warnings.
   Introduce _add_field() and _is_same_field() to libdm-report.c.
   Fix some libdevmapper-event and dmeventd memory leaks.
dmsetup/dmsetup.c +12 -11
@@ -962,17 +962,18 @@
 			if (data && !_switches[VERBOSE_ARG])
 				printf("%s: ", name);
 			if (target_type) {
-
-			/* Suppress encryption key */
-			if (!_switches[SHOWKEYS_ARG] &&
-			    !strcmp(target_type, "crypt")) {
-				c = params;
-				while (*c && *c != ' ')
-					c++;
-				c++;
-				while (*c && *c != ' ')
-					*c++ = '0';
-			}
+				/* Suppress encryption key */
+				if (!_switches[SHOWKEYS_ARG] &&
+				    cmd == DM_DEVICE_TABLE &&
+				    !strcmp(target_type, "crypt")) {
+					c = params;
+					while (*c && *c != ' ')
+						c++;
+					if (*c)
+						c++;
+					while (*c && *c != ' ')
+						*c++ = '0';
+				}
 				printf("%" PRIu64 " %" PRIu64 " %s %s",
 				       start, length, target_type, params);
 			}