aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/rfb/Hostname.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/rfb/Hostname.h b/common/rfb/Hostname.h
index ebdf816f..f70347f9 100644
--- a/common/rfb/Hostname.h
+++ b/common/rfb/Hostname.h
@@ -28,6 +28,8 @@ namespace rfb {
static void getHostAndPort(const char* hi, char** host, int* port, int basePort=5900) {
CharArray portBuf;
CharArray hostBuf;
+ if (hi == NULL)
+ throw rdr::Exception("NULL host specified");
if (hi[0] == '[') {
if (!strSplit(&hi[1], ']', &hostBuf.buf, &portBuf.buf))
throw rdr::Exception("unmatched [ in host");