Commit 127cfcc2 authored by Ahmad Samir's avatar Ahmad Samir Committed by Daniel Vrátil

Fix crash in SessionPool::requestPassword

If the connection to the imap server is lost, m_account becomes null and
requestPassword would crash trying to access a nullptr. Check m_account in
processPendingRequests and bail out if the connection is lost. Note that a
similar check is used in onPasswordRequestDone.

BUG: 415339
parent 3b716e58
Pipeline #31655 failed with stage
in 32 minutes and 44 seconds
......@@ -273,6 +273,15 @@ void SessionPool::cancelSessionCreation(KIMAP::Session *session, int errorCode,
void SessionPool::processPendingRequests()
{
if (!m_account) {
// The connection to the server is lost; no point processing pending requests
for (int request : qAsConst(m_pendingRequests)) {
Q_EMIT sessionRequestDone(request, nullptr,
LoginFailError, i18n("Disconnected from server during login."));
}
return;
}
if (!m_unusedPool.isEmpty()) {
// We have a session ready to give out
KIMAP::Session *session = m_unusedPool.takeFirst();
......
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