ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
572a44
From c6d39712453c53e8c859d6682f65d8129afc35a3 Mon Sep 17 00:00:00 2001
a4b143
From: Lennart Poettering <lennart@poettering.net>
a4b143
Date: Wed, 2 Oct 2013 19:38:28 +0200
a4b143
Subject: [PATCH] strv: don't access potentially NULL string arrays
a4b143
a4b143
---
a4b143
 src/shared/env-util.c | 4 +++-
a4b143
 1 file changed, 3 insertions(+), 1 deletion(-)
a4b143
a4b143
diff --git a/src/shared/env-util.c b/src/shared/env-util.c
a4b143
index 5e29629..7976881 100644
a4b143
--- a/src/shared/env-util.c
a4b143
+++ b/src/shared/env-util.c
a4b143
@@ -405,7 +405,9 @@ char **strv_env_clean_log(char **e, const char *message) {
a4b143
                 e[k++] = *p;
a4b143
         }
a4b143
 
a4b143
-        e[k] = NULL;
a4b143
+        if (e)
a4b143
+                e[k] = NULL;
a4b143
+
a4b143
         return e;
a4b143
 }
a4b143