From 8ce2b410d2085de9b834a825ccc5b3cae00b7e45 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 26 Jun 2018 19:15:28 -0700 Subject: [PATCH] Ensure the PC that responded is the one we're querying --- app/http/computermanager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/http/computermanager.cpp b/app/http/computermanager.cpp index 5dc772db..a43a8904 100644 --- a/app/http/computermanager.cpp +++ b/app/http/computermanager.cpp @@ -57,6 +57,12 @@ class PcMonitorThread : public QThread return false; } + // Ensure the machine that responded is the one we intended to contact + if (!m_Computer->uuid.isNull() && m_Computer->uuid != http.getXmlString(serverInfo, "uniqueid")) { + qInfo() << "Found unexpected PC at address " << address; + return false; + } + changed = false; QString newName = http.getXmlString(serverInfo, "hostname");