summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-11 03:58:45 +0200
committerRay Strode <rstrode@redhat.com>2009-08-11 17:45:57 -0400
commit17fe9ecafedffde111fd0ac95d5688bf5a330972 (patch)
treefc40a3c0d459c916866f52e4b8b4d60504830c7e
parent90ddcd8249e81341ec05fdb508b6768684ce178b (diff)
Enforce that the env array has the right size
Hit an assert if folks add env vars but don't increase the env var array size.
-rw-r--r--src/ck-session.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ck-session.c b/src/ck-session.c
index 97e1ce2..032d2b9 100644
--- a/src/ck-session.c
+++ b/src/ck-session.c
@@ -1285,6 +1285,8 @@ ck_session_run_programs (CkSession *session,
extra_env[n++] = g_strdup_printf ("CK_SESSION_IS_LOCAL=%s", session->priv->is_local ? "true" : "false");
extra_env[n++] = NULL;
+ g_assert(n <= G_N_ELEMENTS(extra_env));
+
ck_run_programs (SYSCONFDIR "/ConsoleKit/run-session.d", action, extra_env);
ck_run_programs (PREFIX "/lib/ConsoleKit/run-session.d", action, extra_env);