From e5b7873f94e4eaf15e136442237752cba005ed3a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 3 Sep 2015 16:36:49 +0100 Subject: [PATCH] Another fix to partial loading of maps. --- src/libutil/map.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.39.5