Fixed crash when using Allowed/Denied Viewers, and the viewer's name is shorter than one of the test strings
This fixes http://opensimulator.org/mantis/view.php?id=72940.8.0.3
parent
3176237169
commit
422f718949
|
@ -3465,7 +3465,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (string viewer in m_AllowedViewers)
|
foreach (string viewer in m_AllowedViewers)
|
||||||
{
|
{
|
||||||
if (viewer == curViewer.Substring(0, viewer.Length).Trim().ToLower())
|
if (viewer == curViewer.Substring(0, Math.Min(viewer.Length, curViewer.Length)).Trim().ToLower())
|
||||||
{
|
{
|
||||||
ViewerDenied = false;
|
ViewerDenied = false;
|
||||||
break;
|
break;
|
||||||
|
@ -3482,7 +3482,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
foreach (string viewer in m_BannedViewers)
|
foreach (string viewer in m_BannedViewers)
|
||||||
{
|
{
|
||||||
if (viewer == curViewer.Substring(0, viewer.Length).Trim().ToLower())
|
if (viewer == curViewer.Substring(0, Math.Min(viewer.Length, curViewer.Length)).Trim().ToLower())
|
||||||
{
|
{
|
||||||
ViewerDenied = true;
|
ViewerDenied = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue