mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-28 15:42:30 +00:00
BUG/MINOR: config: Stopped parsing upon unmatched environment variables
When an environment variable could not be matched by getenv(), the current character to be parsed by parse_line() from <in> variable is the trailing double quotes. If nothing is done in such a case, this character is skipped by parse_line(), then the following spaces are parsed as an empty argument. To fix this, skip the double quotes character and the following spaces to make <in> variable point to the next argument to be parsed. Thank you to @sigint2 for having reported this issue in GH #2367. Must be backported as far as 2.4.
This commit is contained in:
parent
fa0a304f35
commit
ff8db5a85d
15
src/tools.c
15
src/tools.c
@ -5809,6 +5809,21 @@ uint32_t parse_line(char *in, char *out, size_t *outlen, char **args, int *nbarg
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* An unmatched environment variable was parsed.
|
||||
* Let's skip the trailing double-quote character
|
||||
* and spaces.
|
||||
*/
|
||||
if (likely(*var_name != '.') && *in == '"') {
|
||||
in++;
|
||||
while (isspace((unsigned char)*in))
|
||||
in++;
|
||||
if (dquote) {
|
||||
dquote = 0;
|
||||
quote = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
word_expand = NULL;
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user