[dovecot-cvs] dovecot/src/lib-index mail-cache-fields.c,1.21,1.22

cras at dovecot.org cras at dovecot.org
Fri Jun 16 12:26:54 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv6992

Modified Files:
	mail-cache-fields.c 
Log Message:
If cache field's size is wrong, rebuild the cache file instead of crashing
sometimes later.



Index: mail-cache-fields.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-fields.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- mail-cache-fields.c	31 Mar 2006 14:06:52 -0000	1.21
+++ mail-cache-fields.c	16 Jun 2006 09:26:52 -0000	1.22
@@ -244,7 +244,15 @@
 			}
 			if (cache->fields[field.idx].field.type != types[i]) {
 				mail_cache_set_corrupted(cache,
-					"registered field type changed");
+					"registered field %s type changed",
+					names);
+				return -1;
+			}
+			if (cache->fields[field.idx].field.field_size !=
+			    sizes[i]) {
+				mail_cache_set_corrupted(cache,
+					"registered field %s size changed",
+					names);
 				return -1;
 			}
 		} else {



More information about the dovecot-cvs mailing list