Fix crash due to begin and end belonging to different iterators

(cherry picked from commit a33eb46d9b)
This commit is contained in:
Albert Vaca Cintora 2023-07-22 15:12:29 +02:00
parent 80576d8599
commit 775b72fd4a

View file

@ -38,7 +38,8 @@ bool SftpPlugin::startBrowsing()
bool SftpPlugin::receivePacket(const NetworkPacket &np)
{
QSet<QString> receivedFields(np.body().keys().begin(), np.body().keys().end());
QStringList receivedFieldsList = np.body().keys();
QSet<QString> receivedFields(receivedFieldsList.begin(), receivedFieldsList.end());
if (!(expectedFields - receivedFields).isEmpty()) {
qCWarning(KDECONNECT_PLUGIN_SFTP) << "Invalid packet received.";
for (QString missingField : (expectedFields - receivedFields)) {