aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDisconnect3d <dominik.b.czarnota@gmail.com>2020-04-13 16:26:06 +0200
committerWilliam Hubbs <w.d.hubbs@gmail.com>2021-02-22 15:34:45 -0600
commitf5dd2f5baf1a33173c8ac47495e53d32aee834f5 (patch)
treeefb269f6593de29059b03a567aee317d246b6b12
parentb12c52d40f2221e6e2b3ae0296d45c607845ea2a (diff)
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.
-rw-r--r--src/rc/supervise-daemon.c4
1 files changed, 2 insertions, 2 deletions
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, '=');