From: Wayne Davison Date: Sat, 24 Dec 2011 20:18:40 +0000 (-0800) Subject: Complain if the --block-size=N value is too large. X-Git-Tag: v3.1.0pre1~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d74512eb054666198203cdaaaca29a18ba958725;p=thirdparty%2Frsync.git Complain if the --block-size=N value is too large. Fixes bug 8036. --- diff --git a/options.c b/options.c index 9e95c86a..2e1c1880 100644 --- a/options.c +++ b/options.c @@ -1890,6 +1890,12 @@ int parse_arguments(int *argc_p, const char ***argv_p) } #endif + if (block_size > MAX_BLOCK_SIZE) { + snprintf(err_buf, sizeof err_buf, + "--block-size=%lu is too large (max: %u)\n", block_size, MAX_BLOCK_SIZE); + return 0; + } + if (write_batch && read_batch) { snprintf(err_buf, sizeof err_buf, "--write-batch and --read-batch can not be used together\n");