teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0010-strv-don-t-access-potentially-NULL-string-arrays.patch

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