If a moap entry has EnableWhiteList but WhiteList == null, then properly block the request instead of throwing an exception.

Normally, WhiteList is an empty list but from Mantis 7389 it looks like it might sometimes be possible for it to be null (haven't seen this up till now)
It looks like failing with an exception instead of properly replying to the request (which comes in via a cap) might be enough, surprisingly, to freeze a viewer until timeout.
Part of http://opensimulator.org/mantis/view.php?id=7389 but probably unrelated to the actual issue of that mantis.
mb-throttle-test
Justin Clark-Casey (justincc) 2014-12-23 20:38:20 +00:00
parent 7100475b90
commit fc940ab09a
1 changed files with 3 additions and 0 deletions

View File

@ -595,6 +595,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap
/// <returns>true if the url matches an entry on the whitelist, false otherwise</returns>
protected bool CheckUrlAgainstWhitelist(string rawUrl, string[] whitelist)
{
if (whitelist == null)
return false;
Uri url = new Uri(rawUrl);
foreach (string origWlUrl in whitelist)