Skip to content

Commit

Permalink
[sftp] Fix crash after mount timed out
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nicolasfella committed Oct 26, 2024
1 parent 05963ba commit 2e5b1e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/sftp/sftpplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2e5b1e1

Please sign in to comment.