changeset 8373:eb03f8c375fa HEAD

imap: FETCH BODY[HEADER.FIELDS (..)] may have tried to fetch garbage field names. Such situations were quite likely to cause a crash though.
author Timo Sirainen <tss@iki.fi>
date Mon, 29 Aug 2011 06:46:53 +0300
parents d9f9ca8c7fe2
children eadc6ecd92a8
files src/imap/imap-fetch-body.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/imap-fetch-body.c	Wed May 11 18:03:31 2011 +0300
+++ b/src/imap/imap-fetch-body.c	Mon Aug 29 06:46:53 2011 +0300
@@ -777,7 +777,8 @@
 
 		if (i != 0)
 			str_append_c(str, ' ');
-		arr[i] = t_str_ucase(IMAP_ARG_STR(&args[i]));
+		arr[i] = p_strdup(ctx->cmd->pool,
+				  t_str_ucase(IMAP_ARG_STR(&args[i])));
 
 		if (args[i].type == IMAP_ARG_ATOM)
 			str_append(str, arr[i]);