[dm-devel] [PATCH 12/57] multipathd: fixup a crash when invoking CLI commands

Hannes Reinecke hare at suse.de
Wed Apr 27 11:10:13 UTC 2016


The command buffer wasn't cleared, so the CLI might crash on startup.

Signed-off-by: Hannes Reinecke <hare at suse.de>
---
 multipathd/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/multipathd/main.c b/multipathd/main.c
index d9c0b8b..18b225a 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -2244,6 +2244,7 @@ main (int argc, char *argv[])
 
 		if (load_config(DEFAULT_CONFIGFILE, udev_new()))
 			exit(1);
+		memset(cmd, 0x0, CMDSIZE);
 		while (optind < argc) {
 			if (strchr(argv[optind], ' '))
 				c += snprintf(c, s + CMDSIZE - c, "\"%s\" ", argv[optind]);
-- 
2.6.6




More information about the dm-devel mailing list