]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
crashfix on error
authorTimo Sirainen <tss@iki.fi>
Mon, 14 Jun 2004 05:26:02 +0000 (08:26 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 14 Jun 2004 05:26:02 +0000 (08:26 +0300)
--HG--
branch : HEAD

src/lib-index/mail-index.c

index 48d2e0adf2a3730041ea6abdbc67b1ac41728725..acb30e168a067c859c3e622224ad7f9e3c97c4a4 100644 (file)
@@ -218,6 +218,7 @@ static int mail_index_mmap(struct mail_index *index, struct mail_index_map *map)
        }
 
        hdr = map->mmap_base;
+       map->hdr = hdr;
        map->mmap_used_size = hdr->header_size +
                hdr->messages_count * index->record_size;
 
@@ -226,12 +227,11 @@ static int mail_index_mmap(struct mail_index *index, struct mail_index_map *map)
                        index->record_size;
                mail_index_set_error(index, "Corrupted index file %s: "
                                     "messages_count too large (%u > %u)",
-                                    index->filepath, map->hdr->messages_count,
+                                    index->filepath, hdr->messages_count,
                                     records_count);
                return 0;
        }
 
-       map->hdr = hdr;
        if (map->hdr->base_header_size < sizeof(*map->hdr)) {
                /* header smaller than ours, make a copy so our newer headers
                   won't have garbage in them */