diff options
author | Wayne Davison <wayne@opencoder.net> | 2020-07-27 14:42:21 -0700 |
---|---|---|
committer | Wayne Davison <wayne@opencoder.net> | 2020-07-27 14:49:51 -0700 |
commit | e1e546d67e72a83d6e6b6d9ed54f2a4d7e1a6d27 (patch) | |
tree | b9145d3015cca333545a17ddd831e93ef5bcf98a | |
parent | 3714084f4806e6d23fccea1b88e8e4821a1d39d7 (diff) | |
download | rsync-e1e546d67e72a83d6e6b6d9ed54f2a4d7e1a6d27.tar.gz |
Don't allow a completely empty source arg.
-rw-r--r-- | NEWS.md | 3 | ||||
-rw-r--r-- | main.c | 7 |
2 files changed, 10 insertions, 0 deletions
@@ -26,6 +26,9 @@ - Rsync now complains about a missing `--temp-dir` before starting any file transfers. + - A completely empty source arg is now a fatal error. This doesn't change + the handling of implied dot-dir args such as "localhost:" and such. + ### ENHANCEMENTS: - Allow `--max-alloc=0` to specify no limit to the alloc sanity check. @@ -1482,8 +1482,15 @@ static int start_client(int argc, char *argv[]) char *dummy_host; int dummy_port = rsync_port; int i; + if (!argv[0][0]) + goto invalid_empty; /* For local source, extra source args must not have hostspec. */ for (i = 1; i < argc; i++) { + if (!argv[i][0]) { + invalid_empty: + rprintf(FERROR, "Empty source arg specified.\n"); + exit_cleanup(RERR_SYNTAX); + } if (check_for_hostspec(argv[i], &dummy_host, &dummy_port)) { rprintf(FERROR, "Unexpected remote arg: %s\n", argv[i]); exit_cleanup(RERR_SYNTAX); |