X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/36e715fdf295b975105dce63581d9cf9f154f34f..ae306a2933c7617493d80f46d891911634ec43d0:/remote-option.diff diff --git a/remote-option.diff b/remote-option.diff index cc1ccc1..35efdbf 100644 --- a/remote-option.diff +++ b/remote-option.diff @@ -68,7 +68,7 @@ diff --git a/options.c b/options.c case OPT_WRITE_BATCH: /* batch_name is already set */ write_batch = 1; -@@ -1832,6 +1858,11 @@ void server_options(char **args, int *argc_p) +@@ -1840,6 +1866,11 @@ void server_options(char **args, int *argc_p) argstr[x] = '\0'; @@ -80,15 +80,10 @@ diff --git a/options.c b/options.c args[ac++] = argstr; #ifdef ICONV_OPTION -@@ -2053,6 +2084,21 @@ void server_options(char **args, int *argc_p) +@@ -2061,6 +2092,16 @@ void server_options(char **args, int *argc_p) else if (remove_source_files) args[ac++] = "--remove-sent-files"; -+ if (ac > MAX_SERVER_ARGS) { /* Not possible... */ -+ rprintf(FERROR, "argc overflow in server_options().\n"); -+ exit_cleanup(RERR_MALLOC); -+ } -+ + if (remote_option_cnt) { + int j; + if (ac + remote_option_cnt > MAX_SERVER_ARGS) { @@ -99,9 +94,9 @@ diff --git a/options.c b/options.c + args[ac++] = (char*)remote_options[j]; + } + - *argc_p = ac; - return; - + if (ac > MAX_SERVER_ARGS) { /* Not possible... */ + rprintf(FERROR, "argc overflow in server_options().\n"); + exit_cleanup(RERR_MALLOC); diff --git a/pipe.c b/pipe.c --- a/pipe.c +++ b/pipe.c @@ -166,7 +161,7 @@ diff --git a/rsync.yo b/rsync.yo This option is overridden by both bf(--super) and bf(--no-super). -@@ -1281,6 +1282,36 @@ machine for use with the bf(--relative) option. For instance: +@@ -1288,6 +1289,36 @@ machine for use with the bf(--relative) option. For instance: quote(tt( rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/)) @@ -203,7 +198,7 @@ diff --git a/rsync.yo b/rsync.yo dit(bf(-C, --cvs-exclude)) This is a useful shorthand for excluding a broad range of files that you often don't want to transfer between systems. It uses a similar algorithm to CVS to determine if -@@ -1752,7 +1783,7 @@ option if you wish to override this. +@@ -1764,7 +1795,7 @@ option if you wish to override this. Here's a example command that requests the remote side to log what is happening: