X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/a64840a29d2bf486e6167bd2c6cc4ba4210e2d82..929002a2d5e6491c63877836deb67834f87918f7:/generator.c diff --git a/generator.c b/generator.c index 01398b58..b12087fc 100644 --- a/generator.c +++ b/generator.c @@ -567,6 +567,12 @@ static void sum_sizes_sqroot(struct sum_struct *sum, int64 len) int s2length; int64 l; + if (len < 0) { + /* The file length overflowed our int64 var, so we can't process this file. */ + sum->count = -1; /* indicate overflow error */ + return; + } + if (block_size) blength = block_size; else if (len <= BLOCK_SIZE * BLOCK_SIZE)