about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-12-09 23:22:05 +0100
committerLeah Neukirchen <leah@vuxu.org>2020-12-09 23:22:05 +0100
commitf95439a988d73a5d946433d915cbda6ed82c864d (patch)
tree66a1386d2ac1ddd4702d9cff78fc1beb6db7827f
parentbc021c53b6d49032efab050a8f1f6b44804916ac (diff)
downloadmblaze-f95439a988d73a5d946433d915cbda6ed82c864d.tar.gz
mblaze-f95439a988d73a5d946433d915cbda6ed82c864d.tar.xz
mblaze-f95439a988d73a5d946433d915cbda6ed82c864d.zip
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.
-rw-r--r--rfc2045.c4
1 files 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')