Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure that the batch-prefix string isn't overly long (avoiding
[rsync/rsync.git]
/
options.c
diff --git
a/options.c
b/options.c
index
b2ffa07
..
166afdb
100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-124,6
+124,7
@@
int quiet = 0;
int always_checksum = 0;
int list_only = 0;
int always_checksum = 0;
int list_only = 0;
+#define MAX_BATCH_PREFIX_LEN 256 /* Must be less than MAXPATHLEN-13 */
char *batch_prefix = NULL;
static int modify_window_set;
char *batch_prefix = NULL;
static int modify_window_set;
@@
-602,6
+603,12
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
"write-batch and read-batch can not be used together\n");
exit_cleanup(RERR_SYNTAX);
}
"write-batch and read-batch can not be used together\n");
exit_cleanup(RERR_SYNTAX);
}
+ if (batch_prefix && strlen(batch_prefix) > MAX_BATCH_PREFIX_LEN) {
+ rprintf(FERROR,
+ "the batch_prefix string must be %d characters or less.\n",
+ MAX_BATCH_PREFIX_LEN);
+ exit_cleanup(RERR_SYNTAX);
+ }
if (do_compression && (write_batch || read_batch)) {
rprintf(FERROR,
if (do_compression && (write_batch || read_batch)) {
rprintf(FERROR,
@@
-707,7
+714,7
@@
void server_options(char **args,int *argc)
static char mwindow[30];
static char bw[50];
/* Leave room for ``--(write|read)-batch='' */
static char mwindow[30];
static char bw[50];
/* Leave room for ``--(write|read)-batch='' */
- static char fext[MAX
PATH
LEN + 15];
+ static char fext[MAX
_BATCH_PREFIX_
LEN + 15];
int i, x;
int i, x;