summaryrefslogtreecommitdiff
path: root/src/basic/exec-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/exec-util.c')
-rw-r--r--src/basic/exec-util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/exec-util.c b/src/basic/exec-util.c
index 207fac8dc1..aced9e8e3d 100644
--- a/src/basic/exec-util.c
+++ b/src/basic/exec-util.c
@@ -279,6 +279,11 @@ static int gather_environment_generate(int fd, void *arg) {
STRV_FOREACH_PAIR(x, y, new) {
char *p;
+ if (!env_name_is_valid(*x)) {
+ log_warning("Invalid variable assignment \"%s=...\", ignoring.", *x);
+ continue;
+ }
+
p = strjoin(*x, "=", *y);
if (!p)
return -ENOMEM;