From: Timo Sirainen Date: Wed, 10 Sep 2008 18:53:13 +0000 (+0300) Subject: Don't try to allocate too much memory if extension intro had too high ext_id. X-Git-Tag: 1.2.alpha2~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6bb0cb66286440890afad9b993baa7889299ea2c;p=thirdparty%2Fdovecot%2Fcore.git Don't try to allocate too much memory if extension intro had too high ext_id. --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-index-sync-ext.c b/src/lib-index/mail-index-sync-ext.c index 406802b8cc..81f5336064 100644 --- a/src/lib-index/mail-index-sync-ext.c +++ b/src/lib-index/mail-index-sync-ext.c @@ -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);