diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-01-12 23:21:52 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-01-13 21:13:38 +0200 |
commit | f3778f7fcc6b691ddf53743f17d0c27c4232ce94 (patch) | |
tree | 59aefc918e2d56ba58807e8170a8ade046c4d807 /indra/newview | |
parent | 1b90d81fdf68932a298498c9913a9680f79b29d0 (diff) |
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.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llworld.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
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 @@ -1199,6 +1199,16 @@ public: return; } + if (gDisconnected) + { + return; + } + + if (!LLWorld::instanceExists()) + { + return; + } + if (!input["body"].has("agent-id") || !input["body"].has("sim-ip-and-port") || !input["body"].has("seed-capability")) @@ -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"]); } }; |