From 57d2c72e6d41410f25ccc5ab661fcd46e4e68866 Mon Sep 17 00:00:00 2001 From: Jeriko One Date: Thu, 26 Oct 2017 19:34:24 -0700 Subject: [PATCH] handle no arguments to do_server_sender --- main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 3908ccf5..cf5b6eb5 100644 --- a/main.c +++ b/main.c @@ -783,7 +783,7 @@ static void read_final_goodbye(int f_in, int f_out) static void do_server_sender(int f_in, int f_out, int argc, char *argv[]) { struct file_list *flist; - char *dir = argv[0]; + char *dir; if (DEBUG_GTE(SEND, 1)) rprintf(FINFO, "server_sender starting pid=%d\n", (int)getpid()); @@ -800,7 +800,14 @@ static void do_server_sender(int f_in, int f_out, int argc, char *argv[]) exit_cleanup(RERR_SYNTAX); return; } + if(argc == 0) + { + rprintf(FERROR, "ERROR: missing arguments to server_sender\n"); + exit_cleanup(RERR_SYNTAX); + return; + } + dir = argv[0]; if (!relative_paths) { if (!change_dir(dir, CD_NORMAL)) { rsyserr(FERROR, errno, "change_dir#3 %s failed", -- 2.13.6