aboutsummaryrefslogtreecommitdiffstats
path: root/src/statfile.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-20 18:13:19 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-20 18:13:19 +0400
commitde116af023c1bcabe862b222a1008d8dccee73c3 (patch)
treee09b456579e741c12dd99ea122f8c7bbfcad26fc /src/statfile.c
parent966ffa12854e46ede0e1fe67fa5d02345b6e99a0 (diff)
downloadrspamd-de116af023c1bcabe862b222a1008d8dccee73c3.tar.gz
rspamd-de116af023c1bcabe862b222a1008d8dccee73c3.zip
* Fix reading of last block
Diffstat (limited to 'src/statfile.c')
-rw-r--r--src/statfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/statfile.c b/src/statfile.c
index e44af6c2b..d8eb7635e 100644
--- a/src/statfile.c
+++ b/src/statfile.c
@@ -445,7 +445,7 @@ statfile_pool_get_block (statfile_pool_t * pool, stat_file_t * file, uint32_t h1
block = (struct stat_file_block *)c;
for (i = 0; i < CHAIN_LENGTH; i++) {
- if (i + blocknum > file->cur_section.length) {
+ if (i + blocknum >= file->cur_section.length) {
break;
}
if (block->hash1 == h1 && block->hash2 == h2) {
@@ -482,7 +482,7 @@ statfile_pool_set_block_common (statfile_pool_t * pool, stat_file_t * file, uint
block = (struct stat_file_block *)c;
for (i = 0; i < CHAIN_LENGTH; i++) {
- if (i + blocknum > file->cur_section.length) {
+ if (i + blocknum >= file->cur_section.length) {
/* Need to expire some block in chain */
msg_debug ("statfile_pool_set_block: chain %u is full, starting expire", blocknum);
break;