[sftp] Fix crash after mount timed out

When the mount failed after timing out we destroy the mounter

If then the packet actually arrives we access a null mounter

Ignore packets in that state

SENTRY: KDECONNECT-KDE-4A
This commit is contained in:
Nicolas Fella 2024-10-20 01:01:52 +02:00
parent 05963bae29
commit 2e5b1e188f

View file

@ -120,6 +120,12 @@ void SftpPlugin::receivePacket(const NetworkPacket &np)
return; return;
} }
// if a packet arrives before mounting or after the mount timed out, ignore it
if (!m_mounter) {
qCDebug(KDECONNECT_PLUGIN_SFTP) << "Received network packet but no mount is active, ignoring";
return;
}
m_mounter->onPacketReceived(np); m_mounter->onPacketReceived(np);
remoteDirectories.clear(); remoteDirectories.clear();