fix no space after token in MIME header

This commit is contained in:
François 2023-09-17 18:36:25 +02:00
parent dae4379ad7
commit eb5b3b3ec7

View File

@ -330,8 +330,10 @@ Attachment::readMime (ifstream &mbox, streamoff &curPos) {
lastVar = line.substr (0, colonPos); lastVar = line.substr (0, colonPos);
toLower (lastVar); toLower (lastVar);
LOG ("find var: " << lastVar); LOG ("find var: " << lastVar);
// XXX check in RFC if " " after ": " (=> +2 or +1) ++colonPos;
string val (cleanString (line.length () >= colonPos+2 ? line.substr (colonPos+2) : "")); if (line.length () >= colonPos && line [colonPos] == ' ')
++colonPos;
string val (cleanString (line.length () >= colonPos ? line.substr (colonPos) : ""));
LOG ("new var: <" << lastVar << " <=> " << val << ">"); LOG ("new var: <" << lastVar << " <=> " << val << ">");
env [lastVar] = val; env [lastVar] = val;
} }