From 89dd7d5275136d7d5d1b2288d944b523e65a903c Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 1 Jul 2010 11:04:58 +0000 Subject: [PATCH] Fix lvm shell crash when input is entirely whitespace. (Xinwei Hu) --- WHATS_NEW | 1 + tools/lvm.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index f5ca1aca1..78a34ad55 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.70 - ================================ + Fix lvm shell crash when input is entirely whitespace. Update partial mode warning message. Preserve memlock balance in clvmd when activation triggers a resume. diff --git a/tools/lvm.c b/tools/lvm.c index d1c2f9b52..0ca5cee7b 100644 --- a/tools/lvm.c +++ b/tools/lvm.c @@ -217,6 +217,9 @@ int lvm_shell(struct cmd_context *cmd, struct cmdline_context *cmdline) continue; } + if (!argc) + continue; + if (!strcmp(argv[0], "lvm")) { argv++; argc--;