]> source.dussan.org Git - rspamd.git/commitdiff
Another fix to partial loading of maps.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 3 Sep 2015 15:36:49 +0000 (16:36 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 3 Sep 2015 15:36:49 +0000 (16:36 +0100)
src/libutil/map.c

index 0f622a20996b209b56798ecb63da162977a7ead3..e632fc8719d9ed01b2df0f8baddbe95801f09101 100644 (file)
@@ -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) {