]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Don't try to allocate too much memory if extension intro had too high ext_id.
authorTimo Sirainen <tss@iki.fi>
Wed, 10 Sep 2008 18:53:13 +0000 (21:53 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 10 Sep 2008 18:53:13 +0000 (21:53 +0300)
--HG--
branch : HEAD

src/lib-index/mail-index-sync-ext.c

index 406802b8cc949a9406d33ec3e3792c39218037ac..81f533606453a2a0ef509e5b454de4874d474c73 100644 (file)
@@ -350,6 +350,11 @@ mail_index_sync_ext_unknown_complain(struct mail_index_sync_map_ctx *ctx,
 {
        unsigned char *p;
 
+       if (ext_map_idx >= 1024) {
+               /* don't try to track too high values */
+               return TRUE;
+       }
+
        if (ctx->unknown_extensions == NULL) {
                ctx->unknown_extensions =
                        buffer_create_dynamic(default_pool, ext_map_idx + 8);