[dovecot-cvs] dovecot/src/lib-index mail-cache.c,1.66,1.67

cras at dovecot.org cras at dovecot.org
Fri Apr 8 02:29:25 EEST 2005


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

Modified Files:
	mail-cache.c 
Log Message:
Don't crash at mail_cache_lock() if mail_cache_map() fails.



Index: mail-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- mail-cache.c	29 Mar 2005 12:18:49 -0000	1.66
+++ mail-cache.c	7 Apr 2005 23:29:22 -0000	1.67
@@ -405,11 +405,12 @@
 			file_cache_invalidate(cache->file_cache, 0,
 					      sizeof(struct mail_cache_header));
 		}
-		if (mail_cache_map(cache, 0, 0) < 0) {
+		if (mail_cache_map(cache, 0, 0) == 0)
+			cache->hdr_copy = *cache->hdr;
+		else {
 			mail_cache_unlock(cache);
 			ret = -1;
 		}
-		cache->hdr_copy = *cache->hdr;
 	}
 
 	mail_index_view_close(view);



More information about the dovecot-cvs mailing list