Skip to content

Commit

Permalink
rfc2045: blaze822_multipart: parse rest when boundary is missing
Browse files Browse the repository at this point in the history
Either the mail got truncated or was wrongly generated, try to go on
by taking the remains of the buffer as part.
  • Loading branch information
leahneukirchen committed Dec 9, 2020
1 parent bc021c5 commit f95439a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rfc2045.c
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit f95439a

Please sign in to comment.