From f95439a988d73a5d946433d915cbda6ed82c864d Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 9 Dec 2020 23:22:05 +0100 Subject: [PATCH] rfc2045: blaze822_multipart: parse rest when boundary is missing Either the mail got truncated or was wrongly generated, try to go on by taking the remains of the buffer as part. --- rfc2045.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rfc2045.c b/rfc2045.c index 0f2f943..d7c2875 100644 --- a/rfc2045.c +++ b/rfc2045.c @@ -182,8 +182,8 @@ blaze822_multipart(struct message *msg, struct message **imsg) char *nextpart = mymemmemnl(part, msg->bodyend - part, mboundary, boundarylen); if (!nextpart) - return 0; // XXX error condition - if (nextpart == part) // invalid empty MIME part + nextpart = msg->bodyend; // no boundary found, take all + else if (nextpart == part) // invalid empty MIME part return 0; // XXX error condition if (*(nextpart-1) == '\n')