Commit 3251df7d authored by Lennart Poettering's avatar Lennart Poettering
Browse files

conf-parser: don't crash when environemnt list is empty

parent 63ad1ab4
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment