]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: FETCH BODY[HEADER.FIELDS (..)] may have tried to fetch garbage field names.
authorTimo Sirainen <tss@iki.fi>
Thu, 28 Jul 2011 09:08:10 +0000 (12:08 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 28 Jul 2011 09:08:10 +0000 (12:08 +0300)
Such situations were quite likely to cause a crash though.

src/imap/imap-fetch-body.c

index f35810c983743a44e832ba48e57831f541998c6f..d2961ee43d6799e63736fa3d12699914682ec356 100644 (file)
@@ -773,7 +773,7 @@ static bool body_section_build(struct imap_fetch_context *ctx,
 
                if (i != 0)
                        str_append_c(str, ' ');
-               arr[i] = t_str_ucase(value);
+               arr[i] = p_strdup(ctx->cmd->pool, t_str_ucase(value));
 
                if (args[i].type == IMAP_ARG_ATOM)
                        str_append(str, arr[i]);