From: Mike Yuan Date: Thu, 17 Apr 2025 21:57:57 +0000 (+0200) Subject: bus-unit-util: do not trigger assertion on "ExecStart=@" X-Git-Tag: v258-rc1~643^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91d5fad9fbbe91617c503bd48d3f16b1f47e3f50;p=thirdparty%2Fsystemd.git bus-unit-util: do not trigger assertion on "ExecStart=@" extract_first_word() normalizes empty string to NULL, triggering the assertion on input string in strv_split_full(). --- diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index c0572aff150..c7bb1b25334 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -354,6 +354,10 @@ static int bus_append_exec_command(sd_bus_message *m, const char *field, const c r = extract_first_word(&eq, &path, NULL, EXTRACT_UNQUOTE|EXTRACT_CUNESCAPE); if (r < 0) return log_error_errno(r, "Failed to parse path: %m"); + if (r == 0) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "No executable path specified, refusing."); + if (isempty(eq)) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Got empty command line, refusing."); } r = strv_split_full(&l, eq, NULL, EXTRACT_UNQUOTE|EXTRACT_CUNESCAPE);