Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9cc4489 authored by Rusty Russell's avatar Rusty Russell
Browse files

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: default avatarArthur Gautier <baloo@gandi.net>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent e5d8f59a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -173,9 +173,9 @@ static char *next_arg(char *args, char **param, char **val)
			if (args[i-1] == '"')
				args[i-1] = '\0';
		}
	}
	if (quoted && args[i-1] == '"')
		args[i-1] = '\0';
	}

	if (args[i]) {
		args[i] = '\0';