Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7163:b7fc50c68c35 HEAD
If extension record was tried to be updated for uid=0, log an error instead
of crashing. Also log error if uid >= next_uid.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 15 Jan 2008 18:16:06 +0200 |
parents | 1bcb1bae8bed |
children | d349cdeddc7d |
files | src/lib-index/mail-index-sync-ext.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync-ext.c Mon Jan 14 07:17:28 2008 +0200 +++ b/src/lib-index/mail-index-sync-ext.c Tue Jan 15 18:16:06 2008 +0200 @@ -557,6 +557,12 @@ i_assert(ctx->cur_ext_map_idx != (uint32_t)-1); i_assert(!ctx->cur_ext_ignore); + if (u->uid == 0 || u->uid >= view->map->hdr.next_uid) { + mail_index_sync_set_corrupted(ctx, + "Extension record update for invalid uid=%u", u->uid); + return -1; + } + if (!mail_index_lookup_seq(view, u->uid, &seq)) return 1;