[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] Avoiding lvm shell crashes on white space only line
- From: Xinwei Hu <hxinwei gmail com>
- To: dm-devel redhat com
- Subject: [dm-devel] Avoiding lvm shell crashes on white space only line
- Date: Thu, 1 Jul 2010 14:32:48 +0800
Hi all,
lvm shell crashes on white-space only lines.
===>
# lvm
lvm> <== white spaces
Segmentation fault (core dumped)
<===
lvm always assuming that argv[0] is accessible. Here's attached a
tentative fix for this issue.
Please consider it for upstream conclusion. ;)
Thanks
diff --git a/tools/lvm.c b/tools/lvm.c
index d1c2f9b..782b642 100644
--- a/tools/lvm.c
+++ b/tools/lvm.c
@@ -217,6 +217,11 @@ int lvm_shell(struct cmd_context *cmd, struct cmdline_context *cmdline)
continue;
}
+ if (argc == 0) {
+ log_debug("Empty input, sorry.");
+ continue;
+ }
+
if (!strcmp(argv[0], "lvm")) {
argv++;
argc--;
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]