]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Don't assert-crash on FETCH BODY[MIME] (return BAD instead)
authorTimo Sirainen <tss@iki.fi>
Wed, 16 Oct 2013 17:16:45 +0000 (20:16 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 16 Oct 2013 17:16:45 +0000 (20:16 +0300)
src/lib-imap-storage/imap-msgpart.c

index 1f2c3e4e5e290054cfd494124e189b1cc4f97754..74dd21566d67b46eee41ae4126c5436d4845bfce 100644 (file)
@@ -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) {