Fix crash due to begin and end belonging to different iterators

This commit is contained in:
Albert Vaca Cintora 2023-07-22 15:12:29 +02:00
parent d8d9d62ac1
commit a33eb46d9b

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)) {