Skip to content

Commit

Permalink
lib-index: Fixed fsck handling extension with invalid header size
Browse files Browse the repository at this point in the history
Fixes:

Panic: file mail-index-sync-ext.c: line 393 (mail_index_sync_ext_init_new): assertion failed: (hdr_buf->used == map->hdr.header_size)
  • Loading branch information
sirainen committed Jun 3, 2016
1 parent c224fff commit 909a45f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib-index/mail-index-fsck.c
Expand Up @@ -277,6 +277,7 @@ mail_index_fsck_extensions(struct mail_index *index, struct mail_index_map *map,
"with invalid header size",
i, name);
hdr->header_size = offset;
buffer_set_used_size(map->hdr_copy_buf, hdr->header_size);
break;
}
if (mail_index_map_ext_hdr_check(hdr, ext_hdr, name,
Expand Down Expand Up @@ -420,6 +421,7 @@ mail_index_fsck_map(struct mail_index *index, struct mail_index_map *map)
mail_index_fsck_records(index, map, &hdr);

map->hdr = hdr;
i_assert(map->hdr_copy_buf->used == map->hdr.header_size);
}

int mail_index_fsck(struct mail_index *index)
Expand Down

0 comments on commit 909a45f

Please sign in to comment.