]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Fix a potential crash when trying to find a better block match.
authorWayne Davison <wayned@samba.org>
Fri, 22 Apr 2011 18:27:16 +0000 (11:27 -0700)
committerWayne Davison <wayned@samba.org>
Fri, 22 Apr 2011 18:27:16 +0000 (11:27 -0700)
match.c

diff --git a/match.c b/match.c
index 658d7866797d412d5a8e895cefa65ed064784dab..154099d121eb344c32596d19a9185d3d9b566736 100644 (file)
--- 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