summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-10-02 19:38:28 +0200
committerLennart Poettering <lennart@poettering.net>2013-10-02 19:45:12 +0200
commit5b4fb02d890d5c9777e9a6e798e0b8922a8a9fd8 (patch)
treee24e1b34b5733352cf170eabc25aa2aeac6ed6cf /src/shared
parent62678deda2dcd43954bf02f783da01e48c7f8fce (diff)
strv: don't access potentially NULL string arrays
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/env-util.c4
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;
}