]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fill mail_index_map.hdr_copy_buf also when mmap()ing index
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 19 Jan 2021 10:42:02 +0000 (12:42 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 3 May 2021 13:01:05 +0000 (13:01 +0000)
This doesn't seem to have been necessary so far, but will be required by
the following changes.

src/lib-index/mail-index-map-read.c

index c39eb3bd53cb7c92b1a706432602d0434d924ab6..7ebe42d3ce3513e138a3433d1ec0d13812a33c38 100644 (file)
@@ -97,6 +97,8 @@ static int mail_index_mmap(struct mail_index_map *map, uoff_t file_size)
        }
 
        mail_index_map_copy_hdr(map, hdr);
+       buffer_set_used_size(map->hdr_copy_buf, 0);
+       buffer_append(map->hdr_copy_buf, rec_map->mmap_base, hdr->header_size);
 
        map->hdr_base = rec_map->mmap_base;
        rec_map->records = PTR_OFFSET(rec_map->mmap_base, map->hdr.header_size);