strv: don't access potentially NULL string arrays
authorLennart Poettering <lennart@poettering.net>
Wed, 2 Oct 2013 17:38:28 +0000 (19:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 2 Oct 2013 17:45:12 +0000 (19:45 +0200)
src/shared/env-util.c

index 5e29629..7976881 100644 (file)
@@ -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;
 }