Avoiding lvm shell crashes on white space only line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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--;
--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux