summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-01-05 06:31:58 +0000
committerAndrew Tridgell <tridge@samba.org>1999-01-05 06:31:58 +0000
commit496d9272c1b3094e4a1c31273af5401bac1720c0 (patch)
tree07eab2c4f38fc2ea6168b4b5b6d4c0ff43a9e2c4 /match.c
parent34d3eed4627bbb30ff77c92e2c055c3e5836de77 (diff)
downloadrsync-496d9272c1b3094e4a1c31273af5401bac1720c0.tar.gz
don't try to match checksums of two blocks which are of unequal
size. This explains the high false_alarms rate that I saw for one of the sample data files used in my thesis. The bug was harmless as the strong checksum easily caught all the false matches but it's been bugging me as I couldn't explain it :)
Diffstat (limited to 'match.c')
-rw-r--r--match.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/match.c b/match.c
index c231c2ac..613eaec8 100644
--- a/match.c
+++ b/match.c
@@ -178,7 +178,7 @@ static void hash_search(int f,struct sum_struct *s,
for (; j<s->count && targets[j].t == t; j++) {
int i = targets[j].i;
- if (sum != s->sums[i].sum1) continue;
+ if (sum != s->sums[i].sum1 || s->sums[i].len > (len-offset)) continue;
if (verbose > 3)
rprintf(FINFO,"potential match at %d target=%d %d sum=%08x\n",