1
1
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:
Lennart Poettering 2010-04-06 02:37:47 +02:00
parent 63ad1ab4f3
commit 3251df7dd7

View File

@ -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;