From 287a385e63cbe2688d312e3bd1f2ba36180cd6f8 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Wed, 5 Aug 2026 18:51:27 -0400 Subject: [PATCH] cond: fixup path buffer size to fit the longest condition name cond_path() and cond_checkpath() built the /run/finit/cond/ path in a MAX_ARG_LEN buffer, so condition names longer than ~40 chars were truncated. --- src/cond-w.c | 2 +- src/cond.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cond-w.c b/src/cond-w.c index 03195aa6..b3662d6e 100644 --- a/src/cond-w.c +++ b/src/cond-w.c @@ -206,7 +206,7 @@ static void cond_bump_reconf(void) static int cond_checkpath(const char *path) { - char buf[MAX_ARG_LEN], *dir; + char buf[MAX_COND_LEN + sizeof(_PATH_COND)], *dir; strlcpy(buf, path, sizeof(buf)); dir = dirname(buf); diff --git a/src/cond.c b/src/cond.c index 3d1b06c1..42b4eadd 100644 --- a/src/cond.c +++ b/src/cond.c @@ -47,7 +47,7 @@ const char *condstr(enum cond_state s) const char *cond_path(const char *name) { static char path[256]; - char tmp[MAX_ARG_LEN]; + char tmp[MAX_COND_LEN + sizeof(_PATH_COND)]; snprintf(tmp, sizeof(tmp), _PATH_COND "%s", name);