[dovecot-cvs] dovecot/src/lib-storage/index index-mail.c,1.77,1.78

cras at dovecot.org cras at dovecot.org
Mon Jun 6 00:42:02 EEST 2005


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

Modified Files:
	index-mail.c 
Log Message:
Don't pass NULL date to message_date_parse(). It crashes nowadays.



Index: index-mail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- index-mail.c	26 Apr 2005 18:36:49 -0000	1.77
+++ index-mail.c	5 Jun 2005 21:42:00 -0000	1.78
@@ -263,8 +263,9 @@
 		data->save_sent_date = TRUE;
 		str = mail_get_first_header(_mail, "Date");
 		if (data->sent_date.time == (time_t)-1) {
-			if (!message_date_parse((const unsigned char *)str,
-						(size_t)-1,
+			if (str == NULL ||
+			    !message_date_parse((const unsigned char *)str,
+						strlen(str),
 						&data->sent_date.time, &tz)) {
 				/* 0 == parse error */
 				data->sent_date.time = 0;



More information about the dovecot-cvs mailing list