]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
notify: add one more assert
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 27 Feb 2026 19:22:04 +0000 (20:22 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Sun, 22 Mar 2026 15:52:22 +0000 (16:52 +0100)
We tend to get those preallocated array sizes wrong.
In this case, the count was correct, but add the usual
assert.

src/notify/notify.c

index cdca928f90af9f6802fda6d30f490dbb063a383d..d17df1eafa8915b786f0ee441db00662854b3ee4 100644 (file)
@@ -604,6 +604,7 @@ static int run(int argc, char* argv[]) {
         }
 
         our_env[i++] = NULL;
+        assert(i <= ELEMENTSOF(our_env));
 
         final_env = strv_env_merge((char**) our_env, arg_env);
         if (!final_env)