From 70c1ba3962166853fc7a1e4f2bb1d637104312b1 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 22 Jun 2026 11:52:45 -0400 Subject: General fixes (#149) * Fix missing LF * Return when item is NULL * Explicitly state error condition * strlist_contains: Allow index result argument to be NULL * BUGFIX: strlist_contains now uses strstr instead of strcmp * The match was never intended to be exact * BUGFIX: log_msgv now prints a LF to the same stream as the message * BUGFIX: env_manipulate_pathstr PM_ONCE logic did opposite of what was intended * When strstr finds the path in the system path, it's supposed to free the new system path and exit. In this case it was freeing the path when the path wasn't found that lead to several instances of PATH not being updated correctly * Free result when shell_output fails * join: Fix segfault on memory error * join_ex: Fix leak on memory error * Initialize installer_url and python_override_version to zero * Remove redundant calls to memset --- src/cli/stasis/stasis_main.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src/cli') diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index e660f6b..ef7bf26 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -521,32 +521,21 @@ static void transfer_artifacts(struct Delivery *ctx) { } } -int main(int argc, char *argv[]) { - struct Delivery ctx; - struct Process proc = { - .f_stdout = "", - .f_stderr = "", - .redirect_stderr = 0, - }; +int main(const int argc, char *argv[]) { + struct Delivery ctx = {0}; + char env_name[STASIS_NAME_MAX] = {0}; char env_name_testing[STASIS_NAME_MAX] = {0}; char *delivery_input = NULL; char *config_input = NULL; - char installer_url[PATH_MAX]; - char python_override_version[STASIS_NAME_MAX]; + char installer_url[PATH_MAX] = {0}; + char python_override_version[STASIS_NAME_MAX] = {0}; int user_disabled_docker = false; globals.cpu_limit = get_cpu_count(); if (globals.cpu_limit > 1) { globals.cpu_limit--; // max - 1 } - memset(env_name, 0, sizeof(env_name)); - memset(env_name_testing, 0, sizeof(env_name_testing)); - memset(installer_url, 0, sizeof(installer_url)); - memset(python_override_version, 0, sizeof(python_override_version)); - memset(&proc, 0, sizeof(proc)); - memset(&ctx, 0, sizeof(ctx)); - setup_sysconfdir(); int c; -- cgit