Skip to content

Commit

Permalink
core: initialise script structure in start_validate_reload_conf_child()
Browse files Browse the repository at this point in the history
Due to the path field not being set to NULL, it was attempting to exec
a random string when reload_check_config was configured.

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
  • Loading branch information
pqarmitage committed Apr 28, 2024
1 parent 699bc10 commit b9e991e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion keepalived/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ reload_check_child_thread(thread_ref_t thread)
static void
start_validate_reload_conf_child(void)
{
notify_script_t script;
notify_script_t script = { .path = NULL };
int i;
int ret;
int argc;
Expand Down
2 changes: 1 addition & 1 deletion lib/notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ system_call_script(thread_master_t *m, thread_func_t func, void * arg, unsigned
execve(script->path ? script->path : script->args[0], args.execve_args, environ);

/* error */
log_message(LOG_ALERT, "Error exec-ing command '%s', error %d: %m", script->args[0], errno);
log_message(LOG_ALERT, "Error exec-ing command '%s', error %d: %m", script->path ? script->path : script->args[0], errno);
} else {
retval = system(str = cmd_str(script));

Expand Down

0 comments on commit b9e991e

Please sign in to comment.