[dovecot-cvs] dovecot/src/lib-mail istream-header-filter.c, 1.19, 1.20

cras at dovecot.org cras at dovecot.org
Wed Oct 20 23:19:59 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv8285/lib-mail

Modified Files:
	istream-header-filter.c 
Log Message:
Don't crash if no headers are given (fixes FETCH BODY[n.MIME] crashing)



Index: istream-header-filter.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/istream-header-filter.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- istream-header-filter.c	8 Oct 2004 17:51:48 -0000	1.19
+++ istream-header-filter.c	20 Oct 2004 20:19:57 -0000	1.20
@@ -287,7 +287,8 @@
 	mstream->input = input;
 	i_stream_ref(mstream->input);
 
-	mstream->headers = p_new(pool, const char *, headers_count);
+	mstream->headers = headers_count == 0 ? NULL :
+		p_new(pool, const char *, headers_count);
 	for (i = 0; i < headers_count; i++) 
 		mstream->headers[i] = p_strdup(pool, headers[i]);
 	mstream->headers_count = headers_count;



More information about the dovecot-cvs mailing list