From: Vsevolod Stakhov Date: Thu, 3 Sep 2015 15:36:49 +0000 (+0100) Subject: Another fix to partial loading of maps. X-Git-Tag: 1.0.0~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e5b7873f94e4eaf15e136442237752cba005ed3a;p=thirdparty%2Frspamd.git Another fix to partial loading of maps. --- diff --git a/src/libutil/map.c b/src/libutil/map.c index 0f622a2099..e632fc8719 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) {