dovecot-1.1: Don't crash if trying to reset an extension which h...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Sep 9 17:35:27 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/ad44228f3808
changeset: 7868:ad44228f3808
user: Timo Sirainen <tss at iki.fi>
date: Tue Sep 09 17:35:23 2008 +0300
description:
Don't crash if trying to reset an extension which had a broken intro record.
diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
src/lib-index/mail-index-sync-ext.c | 6 +++++-
diffs (23 lines):
diff -r 241097889792 -r ad44228f3808 src/lib-index/mail-index-sync-ext.c
--- a/src/lib-index/mail-index-sync-ext.c Tue Sep 09 08:48:32 2008 +0300
+++ b/src/lib-index/mail-index-sync-ext.c Tue Sep 09 17:35:23 2008 +0300
@@ -360,7 +360,7 @@ int mail_index_sync_ext_intro(struct mai
/* default to ignoring the following extension updates in case this
intro is corrupted */
- ctx->cur_ext_map_idx = 0;
+ ctx->cur_ext_map_idx = (uint32_t)-2;
ctx->cur_ext_ignore = TRUE;
if (u->ext_id != (uint32_t)-1 &&
@@ -509,6 +509,10 @@ int mail_index_sync_ext_reset(struct mai
"Extension reset without intro prefix");
return -1;
}
+ if (ctx->cur_ext_map_idx == (uint32_t)-2 && ctx->cur_ext_ignore) {
+ /* previous extension intro was broken */
+ return -1;
+ }
/* since we're resetting the extension, don't check cur_ext_ignore */
/* a new index file will be created, so the old data won't be
More information about the dovecot-cvs
mailing list