aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/params.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2015-04-14 23:53:48 -0400
committerRusty Russell <rusty@rustcorp.com.au>2015-04-15 00:01:23 -0400
commitb9cc4489c68de59f7a38ef4e02a9829465a6a544 (patch)
tree7c41d3c24c1144146a8da03b04016235347fdb24 /kernel/params.c
parente5d8f59a5cfa76ab5ebe47622d0c569eddd42fbe (diff)
params: handle quotes properly for values not of form foo="bar".
When starting kernel with arguments like: init=/bin/sh -c "echo arguments" the trailing double quote is not removed which results in following command being executed: /bin/sh -c 'echo arguments"' Reported-by: Arthur Gautier <baloo@gandi.net> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel/params.c')
-rw-r--r--kernel/params.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 728e05b167de..a22d6a759b1a 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -173,9 +173,9 @@ static char *next_arg(char *args, char **param, char **val)
173 if (args[i-1] == '"') 173 if (args[i-1] == '"')
174 args[i-1] = '\0'; 174 args[i-1] = '\0';
175 } 175 }
176 if (quoted && args[i-1] == '"')
177 args[i-1] = '\0';
178 } 176 }
177 if (quoted && args[i-1] == '"')
178 args[i-1] = '\0';
179 179
180 if (args[i]) { 180 if (args[i]) {
181 args[i] = '\0'; 181 args[i] = '\0';