From 23fb7c043491f26c1be9f6f0c91e0f4600df8bc4 Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 18 Dec 2017 16:28:57 +0900 Subject: [PATCH] [Modify] Add null check --- websocket-sharp/Net/EndPointManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/websocket-sharp/Net/EndPointManager.cs b/websocket-sharp/Net/EndPointManager.cs index ebecf459..02eca4fc 100644 --- a/websocket-sharp/Net/EndPointManager.cs +++ b/websocket-sharp/Net/EndPointManager.cs @@ -83,6 +83,9 @@ namespace WebSocketSharp.Net var pref = new HttpListenerPrefix (uriPrefix); var addr = convertToIPAddress (pref.Host); + if (addr == null) + throw new HttpListenerException (87, "Includes an invalid host."); + if (!addr.IsLocal ()) throw new HttpListenerException (87, "Includes an invalid host.");