Skip to content

Commit

Permalink
lib-sieve: edit mail wasn't didn't handle truncated header correctly.
Browse files Browse the repository at this point in the history
If header was truncated, it was treated as an istream error. Also the
istream read errors weren't logged.
  • Loading branch information
sirainen authored and stephanbosch committed May 10, 2016
1 parent 6b436b4 commit 4aebe7e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib-sieve/util/edit-mail.c
Expand Up @@ -826,11 +826,14 @@ static int edit_mail_headers_parse

message_parse_header_deinit(&hparser);

if ( ret <= 0 ) {
/* blocking i/o required */
i_assert( ret != 0 );
/* blocking i/o required */
i_assert( ret != 0 );

if ( ret < 0 && edmail->wrapped_stream->stream_errno != 0 ) {
/* Error; clean up */
i_error("read(%s) failed: %s",
i_stream_get_name(edmail->wrapped_stream),
i_stream_get_error(edmail->wrapped_stream));
current = head;
while ( current != NULL ) {
struct _header_field_index *next = current->next;
Expand Down

0 comments on commit 4aebe7e

Please sign in to comment.