dovecot-1.1: Don't try to allocate too much memory if extension ...

dovecot at dovecot.org dovecot at dovecot.org
Wed Sep 10 21:52:56 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/aa01f9077178
changeset: 7872:aa01f9077178
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Sep 10 21:52:51 2008 +0300
description:
Don't try to allocate too much memory if extension intro had too high ext_id.

diffstat:

1 file changed, 5 insertions(+)
src/lib-index/mail-index-sync-ext.c |    5 +++++

diffs (15 lines):

diff -r 5835adeb6359 -r aa01f9077178 src/lib-index/mail-index-sync-ext.c
--- a/src/lib-index/mail-index-sync-ext.c	Tue Sep 09 19:39:29 2008 +0300
+++ b/src/lib-index/mail-index-sync-ext.c	Wed Sep 10 21:52:51 2008 +0300
@@ -335,6 +335,11 @@ mail_index_sync_ext_unknown_complain(str
 {
 	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);


More information about the dovecot-cvs mailing list