Commit fb2ce5f1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix crash when response is empty

parent de344d62
Pipeline #92955 passed with stage
in 7 minutes and 33 seconds
......@@ -236,7 +236,7 @@ bool ServerTestPrivate::handlePopConversation(MailTransport::Socket *socket, int
// Initial Greeting
if (stage == 0) {
// Regexp taken from POP3 ioslave
const QString responseWithoutCRLF = response.chopped(2);
const QString responseWithoutCRLF = response.isEmpty() ? response : response.chopped(2);
static const QRegularExpression re(QStringLiteral("<[A-Za-z0-9\\.\\-_]+@[A-Za-z0-9\\.\\-_]+>$"), QRegularExpression::CaseInsensitiveOption);
if (responseWithoutCRLF.indexOf(re) != -1) {
authenticationResults[type] << Transport::EnumAuthenticationType::APOP;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment