aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-03 16:36:49 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-03 16:36:49 +0100
commite5b7873f94e4eaf15e136442237752cba005ed3a (patch)
treec3d80d1e28c0bb73455d3f667078091ed52761a6 /src/libutil
parentc1d449d3d3eb2d73fb653f250aeb1a6afba77f45 (diff)
downloadrspamd-e5b7873f94e4eaf15e136442237752cba005ed3a.tar.gz
rspamd-e5b7873f94e4eaf15e136442237752cba005ed3a.zip
Another fix to partial loading of maps.
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/map.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c
index 0f622a209..e632fc871 100644
--- a/src/libutil/map.c
+++ b/src/libutil/map.c
@@ -275,11 +275,15 @@ read_map_file (struct rspamd_map *map, struct file_map_data *data)
tlen += r;
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);
memmove (buf, remain, rlen);
}
+ else {
+ rlen = 0;
+ }
}
if (remain != NULL && remain > buf) {