From 2e5b1e188f214ff9d22471c41086ad5cd88979d5 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sun, 20 Oct 2024 01:01:52 +0200 Subject: [PATCH] [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 --- plugins/sftp/sftpplugin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp index b72a38c3b..a6c721d56 100644 --- a/plugins/sftp/sftpplugin.cpp +++ b/plugins/sftp/sftpplugin.cpp @@ -120,6 +120,12 @@ void SftpPlugin::receivePacket(const NetworkPacket &np) 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); remoteDirectories.clear();