From f3778f7fcc6b691ddf53743f17d0c27c4232ce94 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 12 Jan 2022 23:21:52 +0200 Subject: SL-16637 Better validation of data in LLEstablishAgentCommunication Do not set capability when disconnected, it creates new coroutines that will do nothing and region might be invalid resulting in a crash. Do not initilize LLWorld. --- indra/newview/llworld.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index fb3fc55a94..81511ac555 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1195,6 +1195,16 @@ public: virtual void post(ResponsePtr response, const LLSD& context, const LLSD& input) const { if (LLApp::isExiting()) + { + return; + } + + if (gDisconnected) + { + return; + } + + if (!LLWorld::instanceExists()) { return; } @@ -1207,8 +1217,13 @@ public: return; } - LLHost sim(input["body"]["sim-ip-and-port"].asString()); - + LLHost sim(input["body"]["sim-ip-and-port"].asString()); + if (sim.isInvalid()) + { + LL_WARNS() << "Got EstablishAgentCommunication with invalid host" << LL_ENDL; + return; + } + LLViewerRegion* regionp = LLWorld::getInstance()->getRegion(sim); if (!regionp) { @@ -1217,7 +1232,7 @@ public: return; } LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from LLEstablishAgentCommunication::post. Seed cap == " - << input["body"]["seed-capability"] << LL_ENDL; + << input["body"]["seed-capability"] << " for region " << regionp->getRegionID() << LL_ENDL; regionp->setSeedCapability(input["body"]["seed-capability"]); } }; -- cgit v1.2.3