From: Timo Sirainen Date: Wed, 16 Oct 2013 17:16:45 +0000 (+0300) Subject: imap: Don't assert-crash on FETCH BODY[MIME] (return BAD instead) X-Git-Tag: 2.2.7~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66bc85d333c53c29ef17b92b7964b86fc5f6d186;p=thirdparty%2Fdovecot%2Fcore.git imap: Don't assert-crash on FETCH BODY[MIME] (return BAD instead) --- diff --git a/src/lib-imap-storage/imap-msgpart.c b/src/lib-imap-storage/imap-msgpart.c index 1f2c3e4e5e..74dd21566d 100644 --- a/src/lib-imap-storage/imap-msgpart.c +++ b/src/lib-imap-storage/imap-msgpart.c @@ -254,6 +254,8 @@ int imap_msgpart_parse(const char *section, struct imap_msgpart **msgpart_r) section = t_str_ucase(section); if (strcmp(section, "MIME") == 0) { + if (msgpart->section_number[0] == '\0') + return -1; msgpart->fetch_type = FETCH_MIME; msgpart->wanted_fields |= MAIL_FETCH_STREAM_BODY; } else if (strcmp(section, "TEXT") == 0) {