Browse Source

MIME-19: check for implausible parsing result due to mismatched line ending convention.

master
roker 2 months ago
parent
commit
83b0defab5
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/pEpMIME.cc

+ 6
- 0
src/pEpMIME.cc View File

@ -166,6 +166,12 @@ message* parse_message2(const char* begin, const char* const end)
LOG << "Parsing result: " << headersize << " raw header lines, " << (lines.size()-headersize) << " body lines:\n" << lines;
Message m{lines};
LOG << "Message: header has " << m.headers.size() << " lines, MimeHeaders.mime_type=\"" << m.mh.mime_type() << "\", " << m.body.size() << " body lines.\n";
if(m.headers.size()==0 || (m.headers.size()==1 && m.body.size()==0) )
{
// does not seem to be a correctly parsed MIME message. Maybe wrong line ending? Giving up here.
return nullptr;
}
message* msg = new_message(PEP_dir_incoming);
parse_header(msg, m.headers);


Loading…
Cancel
Save