also check the url on llHTTPRequest before doing anything with garbage

This commit is contained in:
UbitUmarov
2020-12-18 13:11:55 +00:00
parent 5859862162
commit 874808522f

View File

@@ -13572,7 +13572,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llModPow(int a, int b, int c)
{
m_host.AddScriptLPS(1);
Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out long tmp);
Math.DivRem((long)Math.Pow(a, b), c, out long tmp);
ScriptSleep(m_sleepMsOnModPow);
return (int)tmp;
}
@@ -14259,11 +14259,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
IHttpRequestModule httpScriptMod = m_ScriptEngine.World.RequestModuleInterface<IHttpRequestModule>();
if(httpScriptMod == null)
return "";
return string.Empty;
if(!httpScriptMod.CheckThrottle(m_host.LocalId, m_host.OwnerID))
return ScriptBaseClass.NULL_KEY;
try
{
Uri m_checkuri = new Uri(url);
if (m_checkuri.Scheme != Uri.UriSchemeHttp && m_checkuri.Scheme != Uri.UriSchemeHttps)
{
Error("llHTTPRequest", "Invalid url schema");
ScriptSleep(200);
return string.Empty;
}
}
catch
{
Error("llHTTPRequest", "Invalid url");
ScriptSleep(200);
return string.Empty;
}
List<string> param = new List<string>();
bool ok;
int nCustomHeaders = 0;