[dovecot-cvs] dovecot/src/lib-index mail-transaction-log.c, 1.55,
	1.56
    cras at dovecot.org 
    cras at dovecot.org
       
    Sat Sep 11 20:26:27 EEST 2004
    
        - Previous message: [dovecot-cvs] dovecot/src/lib-index mail-cache-compress.c, 1.15,
	1.16 mail-cache-fields.c, 1.6, 1.7 mail-cache-transaction.c,
	1.27, 1.28 mail-index-sync-update.c, 1.43, 1.44
 
        - Next message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.82,
	1.83
 
         -  Messages sorted by: 
              [ date ]
              [ thread ]
              [ subject ]
              [ author ]
         
 
       
    
  
Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv26566
Modified Files:
	mail-transaction-log.c 
Log Message:
Make sure MAIL_TRANSACTION_EXTRA_INTRO is 4 byte padded, otherwise it
crashes.
Index: mail-transaction-log.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-transaction-log.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- mail-transaction-log.c	11 Sep 2004 16:14:10 -0000	1.55
+++ mail-transaction-log.c	11 Sep 2004 17:26:24 -0000	1.56
@@ -1076,9 +1076,12 @@
 	if (size == 0)
 		return 0;
 
-	if (hdr_buf != NULL)
+	i_assert((size % 4) == 0);
+
+	if (hdr_buf != NULL) {
 		hdr_data = buffer_get_data(hdr_buf, &hdr_data_size);
-	else {
+		i_assert((hdr_data_size % 4) == 0);
+	} else {
 		hdr_data = NULL;
 		hdr_data_size = 0;
 	}
@@ -1196,6 +1199,9 @@
 	intro->name_size = strlen(einfo->name);
 	buffer_append(buf, einfo->name, intro->name_size);
 
+	if ((buf->used % 4) != 0)
+		buffer_append(buf, null4, 4 - (buf->used % 4));
+
 	ret = log_append_buffer(file, buf, NULL, MAIL_TRANSACTION_EXTRA_INTRO,
 				t->view->external);
 	t_pop();
    
    
        
	- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-cache-compress.c, 1.15,
	1.16 mail-cache-fields.c, 1.6, 1.7 mail-cache-transaction.c,
	1.27, 1.28 mail-index-sync-update.c, 1.43, 1.44
 
	- Next message: [dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.82,
	1.83
 
         -  Messages sorted by: 
              [ date ]
              [ thread ]
              [ subject ]
              [ author ]
         
 
       
More information about the dovecot-cvs
mailing list