From 62bb385728121b456782d205f6e27d0c18be9c0b Mon Sep 17 00:00:00 2001 From: Serguei Katkov Date: Wed, 29 Oct 2014 19:38:01 +0600 Subject: [PATCH] Fix installd command line parser Parser does not take into account that the last argument can be empty. In this case it will skip end of line marker and continue parsing. Change-Id: I2d029a69ed22cef497893e592ff3275ced97f85f Signed-off-by: Serguei Katkov --- cmds/installd/installd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index b54d56cef..ca69fffcb 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -243,7 +243,9 @@ static int execute(int s, char cmd[BUFFER_MAX]) goto done; } } - cmd++; + if (*cmd) { + cmd++; + } } for (i = 0; i < sizeof(cmds) / sizeof(cmds[0]); i++) {