Skip to content

Commit

Permalink
lib-imap-storage: Don't sort uninitialized array on invalid header list.
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed May 18, 2016
1 parent 564b73a commit 76d21e3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib-imap-storage/imap-msgpart.c
Expand Up @@ -166,13 +166,12 @@ imap_msgpart_get_header_fields(pool_t pool, const char *header_list,
value = p_strdup(pool, t_str_ucase(value));
array_append(fields, &value, 1);
}
/* istream-header-filter requires headers to be sorted */
array_sort(fields, i_strcasecmp_p);
} else {
result = -1;
}

/* istream-header-filter requires headers to be sorted */
array_sort(fields, i_strcasecmp_p);

imap_parser_unref(&parser);
i_stream_unref(&input);
return result;
Expand Down

0 comments on commit 76d21e3

Please sign in to comment.