From: Wayne Davison Date: Fri, 22 Apr 2011 18:27:16 +0000 (-0700) Subject: Fix a potential crash when trying to find a better block match. X-Git-Tag: v3.0.9pre1~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a1d092ae1f184ab5349728587405bacafcd1aaf;p=thirdparty%2Frsync.git Fix a potential crash when trying to find a better block match. --- diff --git a/match.c b/match.c index 658d7866..154099d1 100644 --- a/match.c +++ b/match.c @@ -238,7 +238,7 @@ static void hash_search(int f,struct sum_struct *s, aligned_offset += s->blength; aligned_i++; } - if (offset == aligned_offset) { + if (offset == aligned_offset && aligned_i < s->count) { if (i != aligned_i) { if (sum != s->sums[aligned_i].sum1 || l != s->sums[aligned_i].len