Harden malformed vehicle packet parsing

This commit is contained in:
alex
2026-03-07 21:23:00 -07:00
parent 3befc84f00
commit 48d721f602
2 changed files with 38 additions and 3 deletions
+7 -1
View File
@@ -670,7 +670,13 @@ void TNetwork::TCPClient(const std::weak_ptr<TClient>& c) {
Client->Disconnect("TCPRcv failed");
break;
}
mServer.GlobalParser(c, std::move(res), mPPSMonitor, *this, false);
try {
mServer.GlobalParser(c, std::move(res), mPPSMonitor, *this, false);
} catch (const std::exception& e) {
beammp_warnf("Failed to receive/parse packet via TCP from client {}: {}", Client->GetID(), e.what());
Client->Disconnect("Failed to parse packet");
break;
}
}
if (QueueSync.joinable())