Skip to content
Snippets Groups Projects
Commit f3778f7f authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

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.
parent 1b90d81f
Branches screensquare
No related tags found
No related merge requests found
...@@ -1195,6 +1195,16 @@ class LLEstablishAgentCommunication : public LLHTTPNode ...@@ -1195,6 +1195,16 @@ class LLEstablishAgentCommunication : public LLHTTPNode
virtual void post(ResponsePtr response, const LLSD& context, const LLSD& input) const virtual void post(ResponsePtr response, const LLSD& context, const LLSD& input) const
{ {
if (LLApp::isExiting()) if (LLApp::isExiting())
{
return;
}
if (gDisconnected)
{
return;
}
if (!LLWorld::instanceExists())
{ {
return; return;
} }
...@@ -1208,6 +1218,11 @@ class LLEstablishAgentCommunication : public LLHTTPNode ...@@ -1208,6 +1218,11 @@ class LLEstablishAgentCommunication : public LLHTTPNode
} }
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); LLViewerRegion* regionp = LLWorld::getInstance()->getRegion(sim);
if (!regionp) if (!regionp)
...@@ -1217,7 +1232,7 @@ class LLEstablishAgentCommunication : public LLHTTPNode ...@@ -1217,7 +1232,7 @@ class LLEstablishAgentCommunication : public LLHTTPNode
return; return;
} }
LL_DEBUGS("CrossingCaps") << "Calling setSeedCapability from LLEstablishAgentCommunication::post. Seed cap == " 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"]); regionp->setSeedCapability(input["body"]["seed-capability"]);
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment