From 41979f292b9bc91c031a4f046f07ff77d4088050 Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Sat, 8 Nov 2008 21:49:40 +0000
Subject: Mantis#2590. Thank you kindly, Diva for a patch that solves: When the
 given address to CheckRegion is wrong, it crashes the whole server. Patch
 included.

---
 OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index c4c2ffd..a4fa3bb 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -1547,7 +1547,16 @@ namespace OpenSim.Region.Communications.OGS1
 
             IPAddress ia;
             IPAddress.TryParse(address, out ia);
-            IPEndPoint m_EndPoint = new IPEndPoint(ia, (int)port);
+            IPEndPoint m_EndPoint;
+            try
+            {
+                m_EndPoint = new IPEndPoint(ia, (int)port);
+            }
+            catch (Exception)
+            {
+                m_log.Debug("[OGS1 GRID SERVICES]: Invalid remoting address: " + address);
+                return false;
+            }
 
             AsyncCallback callback = delegate(IAsyncResult iar)
             {
-- 
cgit v1.1