From f5dd2f5baf1a33173c8ac47495e53d32aee834f5 Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Mon, 13 Apr 2020 16:26:06 +0200 Subject: supervise-daemon: Fix off by ones when checking for RC_* envvars Fixes strncmp size argument off by one as the current implementation didn't match the `=` character. This fixes #361. --- src/rc/supervise-daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/rc') diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c index d43f1031..04f67225 100644 --- a/src/rc/supervise-daemon.c +++ b/src/rc/supervise-daemon.c @@ -421,8 +421,8 @@ static void child_process(char *exec, char **argv) TAILQ_FOREACH(env, env_list, entries) { if ((strncmp(env->value, "RC_", 3) == 0 && - strncmp(env->value, "RC_SERVICE=", 10) != 0 && - strncmp(env->value, "RC_SVCNAME=", 10) != 0) || + strncmp(env->value, "RC_SERVICE=", 11) != 0 && + strncmp(env->value, "RC_SVCNAME=", 11) != 0) || strncmp(env->value, "SSD_NICELEVEL=", 14) == 0) { p = strchr(env->value, '='); -- cgit v1.2.3