1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-31 21:18:26 +03:00

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

This commit is contained in:
Alasdair Kergon 2007-04-27 15:12:26 +00:00
parent 477ec611d5
commit b6172b53fd
2 changed files with 13 additions and 11 deletions

View File

@ -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.

View File

@ -962,17 +962,18 @@ static int _status(int argc, char **argv, void *data)
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);
}