diff options
author | Wayne Davison <wayned@samba.org> | 2011-04-22 11:31:29 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2011-04-22 16:06:06 -0700 |
commit | 813d5a25e307bf86169ac6f30b120c02ff116667 (patch) | |
tree | 0226cdead5e309a9de17cdebef4020f6fc5c48b0 /match.c | |
parent | 591c224584c04e0d6f58ece969946bd5472f7c89 (diff) | |
download | rsync-813d5a25e307bf86169ac6f30b120c02ff116667.tar.gz rsync-813d5a25e307bf86169ac6f30b120c02ff116667.tar.bz2 rsync-813d5a25e307bf86169ac6f30b120c02ff116667.zip |
Fix a potential crash when trying to find a better block match.
Diffstat (limited to 'match.c')
-rw-r--r-- | match.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |