X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/13074c982bb4830a21287a1504b0e38a953f4f74..8bd77e7098d9863f258070fb2274e324a446adbd:/io.c diff --git a/io.c b/io.c index 60062f90..6a91ffd5 100644 --- a/io.c +++ b/io.c @@ -1354,6 +1354,7 @@ int read_vstring(int f, char *buf, int bufsize) * called by both the sender and the receiver. */ void read_sum_head(int f, struct sum_struct *sum) { + int32 max_blength = protocol_version < 30 ? OLD_MAX_BLOCK_SIZE : MAX_BLOCK_SIZE; sum->count = read_int(f); if (sum->count < 0) { rprintf(FERROR, "Invalid checksum count %ld [%s]\n", @@ -1361,7 +1362,7 @@ void read_sum_head(int f, struct sum_struct *sum) exit_cleanup(RERR_PROTOCOL); } sum->blength = read_int(f); - if (sum->blength < 0 || sum->blength > MAX_BLOCK_SIZE) { + if (sum->blength < 0 || sum->blength > max_blength) { rprintf(FERROR, "Invalid block length %ld [%s]\n", (long)sum->blength, who_am_i()); exit_cleanup(RERR_PROTOCOL);