Mercurial > dovecot > original-hg > dovecot-1.2
changeset 647:1acbf6c8758c HEAD
handle broken multipart messages without crashing
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 22 Nov 2002 10:37:06 +0200 |
parents | ea7099259c57 |
children | 3663df53b127 |
files | src/lib-imap/imap-bodystructure.c |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-imap/imap-bodystructure.c Thu Nov 21 22:50:53 2002 +0200 +++ b/src/lib-imap/imap-bodystructure.c Fri Nov 22 10:37:06 2002 +0200 @@ -246,7 +246,10 @@ { MessagePartBodyData *data = part->context; - i_assert(data != NULL); + if (data == NULL) { + /* there was no content headers, use an empty structure */ + data = t_new(MessagePartBodyData, 1); + } if (part->children != NULL) part_write_bodystructure(part->children, str, extended); @@ -258,7 +261,10 @@ } t_string_append_c(str, ' '); - t_string_append(str, data->content_subtype); + if (data->content_subtype != NULL) + t_string_append(str, data->content_subtype); + else + t_string_append(str, "x-unknown"); if (!extended) return;