[dovecot-cvs] dovecot/src/lib-imap imap-envelope.c,1.25,1.26

cras at procontrol.fi cras at procontrol.fi
Thu Apr 10 00:07:50 EEST 2003


Update of /home/cvs/dovecot/src/lib-imap
In directory danu:/tmp/cvs-serv32303

Modified Files:
	imap-envelope.c 
Log Message:
Don't crash if mail doesn't have any headers.



Index: imap-envelope.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-envelope.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- imap-envelope.c	26 Mar 2003 17:29:02 -0000	1.25
+++ imap-envelope.c	9 Apr 2003 20:07:47 -0000	1.26
@@ -85,6 +85,11 @@
 	struct message_address **addr_p;
 	char **str_p;
 
+	if (*data == NULL) {
+		*data = p_new(pool, struct message_part_envelope_data, 1);
+		(*data)->pool = pool;
+	}
+
 	if (hdr == NULL || !imap_envelope_get_field(hdr->name, &field))
 		return;
 
@@ -94,12 +99,7 @@
 		return;
 	}
 
-	if (*data == NULL) {
-		*data = p_new(pool, struct message_part_envelope_data, 1);
-		(*data)->pool = pool;
-	}
 	d = *data;
-
 	addr_p = NULL; str_p = NULL;
 	switch (field) {
 	case IMAP_ENVELOPE_DATE:




More information about the dovecot-cvs mailing list