diff options
author | Oren Hurvitz | 2014-08-06 19:02:15 +0300 |
---|---|---|
committer | Justin Clark-Casey | 2014-08-22 19:20:19 +0100 |
commit | 422f718949b560a79a7e15fe4368b8ddcc7f8e17 (patch) | |
tree | 22cc981b9264edab2949a445ac4117a5c1c3ceaf | |
parent | Fixed premature closing of the connection in DataSnapshotManager (diff) | |
download | opensim-SC-422f718949b560a79a7e15fe4368b8ddcc7f8e17.zip opensim-SC-422f718949b560a79a7e15fe4368b8ddcc7f8e17.tar.gz opensim-SC-422f718949b560a79a7e15fe4368b8ddcc7f8e17.tar.bz2 opensim-SC-422f718949b560a79a7e15fe4368b8ddcc7f8e17.tar.xz |
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=7294
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 27929c6..ec6f5c2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3465,7 +3465,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3465 | { | 3465 | { |
3466 | foreach (string viewer in m_AllowedViewers) | 3466 | foreach (string viewer in m_AllowedViewers) |
3467 | { | 3467 | { |
3468 | if (viewer == curViewer.Substring(0, viewer.Length).Trim().ToLower()) | 3468 | if (viewer == curViewer.Substring(0, Math.Min(viewer.Length, curViewer.Length)).Trim().ToLower()) |
3469 | { | 3469 | { |
3470 | ViewerDenied = false; | 3470 | ViewerDenied = false; |
3471 | break; | 3471 | break; |
@@ -3482,7 +3482,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3482 | { | 3482 | { |
3483 | foreach (string viewer in m_BannedViewers) | 3483 | foreach (string viewer in m_BannedViewers) |
3484 | { | 3484 | { |
3485 | if (viewer == curViewer.Substring(0, viewer.Length).Trim().ToLower()) | 3485 | if (viewer == curViewer.Substring(0, Math.Min(viewer.Length, curViewer.Length)).Trim().ToLower()) |
3486 | { | 3486 | { |
3487 | ViewerDenied = true; | 3487 | ViewerDenied = true; |
3488 | break; | 3488 | break; |