changeset 8185:28abdf929037 HEAD

Don't try to allocate too much memory if extension intro had too high ext_id.
author Timo Sirainen <tss@iki.fi>
date Wed, 10 Sep 2008 21:53:13 +0300
parents c22b7db8c173
children 2358ee07d2db
files src/lib-index/mail-index-sync-ext.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync-ext.c	Wed Sep 10 21:46:23 2008 +0300
+++ b/src/lib-index/mail-index-sync-ext.c	Wed Sep 10 21:53:13 2008 +0300
@@ -350,6 +350,11 @@
 {
 	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);