mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
conf-parser: don't crash when environemnt list is empty
This commit is contained in:
parent
63ad1ab4f3
commit
3251df7dd7
@ -368,8 +368,10 @@ int config_parse_strv(
|
||||
if (!(n = new(char*, k+1)))
|
||||
return -ENOMEM;
|
||||
|
||||
for (k = 0; (*sv)[k]; k++)
|
||||
n[k] = (*sv)[k];
|
||||
if (*sv)
|
||||
for (k = 0; (*sv)[k]; k++)
|
||||
n[k] = (*sv)[k];
|
||||
|
||||
FOREACH_WORD_QUOTED(w, l, rvalue, state)
|
||||
if (!(n[k++] = strndup(w, l)))
|
||||
goto fail;
|
||||
|
Loading…
Reference in New Issue
Block a user