diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-10-02 19:38:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-02 19:45:12 +0200 |
commit | 5b4fb02d890d5c9777e9a6e798e0b8922a8a9fd8 (patch) | |
tree | e24e1b34b5733352cf170eabc25aa2aeac6ed6cf | |
parent | 62678deda2dcd43954bf02f783da01e48c7f8fce (diff) |
strv: don't access potentially NULL string arrays
-rw-r--r-- | src/shared/env-util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/env-util.c b/src/shared/env-util.c index 5e29629efd..7976881ef6 100644 --- a/src/shared/env-util.c +++ b/src/shared/env-util.c @@ -405,7 +405,9 @@ char **strv_env_clean_log(char **e, const char *message) { e[k++] = *p; } - e[k] = NULL; + if (e) + e[k] = NULL; + return e; } |