Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
591c224
)
Fix a potential crash when trying to find a better block match.
author
Wayne Davison
<wayned@samba.org>
Fri, 22 Apr 2011 18:31:29 +0000
(11:31 -0700)
committer
Wayne Davison
<wayned@samba.org>
Fri, 22 Apr 2011 23:06:06 +0000
(16:06 -0700)
match.c
patch
|
blob
|
blame
|
history
diff --git
a/match.c
b/match.c
index
9da18a7
..
f327fd3
100644
(file)
--- a/
match.c
+++ b/
match.c
@@
-239,8
+239,9
@@
static void hash_search(int f,struct sum_struct *s,
aligned_offset += s->blength;
aligned_i++;
}
- if (offset == aligned_offset
- || (sum == 0 && l == s->blength && aligned_offset + l <= len)) {
+ if ((offset == aligned_offset
+ || (sum == 0 && l == s->blength && aligned_offset + l <= len))
+ && aligned_i < s->count) {
if (i != aligned_i) {
if (sum != s->sums[aligned_i].sum1
|| l != s->sums[aligned_i].len