aboutsummaryrefslogtreecommitdiffstats
path: root/src/map.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-01 16:40:28 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-01 16:40:28 +0400
commit83cc70ff18209116bd486b4932f206dd5a3fd83f (patch)
treead6693561e07d373d08ca40eae36dd622b5a2795 /src/map.c
parent0f7464cc19e85b0200d7a59f3eb0a93efdcc6ce7 (diff)
downloadrspamd-83cc70ff18209116bd486b4932f206dd5a3fd83f.tar.gz
rspamd-83cc70ff18209116bd486b4932f206dd5a3fd83f.zip
* Fix stupid bug in calculating buffer length while reading file maps
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map.c b/src/map.c
index d6e57715a..b864c6a42 100644
--- a/src/map.c
+++ b/src/map.c
@@ -386,8 +386,9 @@ read_map_file (struct rspamd_map *map, struct file_map_data *data)
rlen = 0;
while ((r = read (fd, buf + rlen, sizeof (buf) - rlen - 1)) > 0) {
- buf[r++] = '\0';
- remain = map->read_callback (map->pool, buf, r - 1, &cbdata);
+ r += rlen;
+ buf[r] = '\0';
+ remain = map->read_callback (map->pool, buf, r, &cbdata);
if (remain != NULL) {
/* copy remaining buffer to start of buffer */
rlen = r - (remain - buf);