Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions api/src/main/java/jakarta/mail/internet/MimeMultipart.java
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,25 @@ protected synchronized void parse() throws MessagingException {
int b2 = in.read();
if (b2 == '-') {
if (in.read() == '-') {
complete = true;
done = true;
break; // ignore trailing text
int b3 = in.read();
// skip linear whitespace
while (b3 == ' ' || b3 == '\t')
{ b3 = in.read(); }
if (b3 == '\n' || b3 == '\r' || b3 == -1)
{
if(b3 == '\r')
{
// consume '\n' if it follows, so that next read
// starts from first character of the epilogue.
// useful if in future epilogue extraction is added
in.mark(1);
if (in.read() != '\n')
{ in.reset(); }
}
complete = true;
done = true;
break; // ignore trailing text
}
}
}
// skip linear whitespace
Expand Down