From 3270a59ae45a88054e8e18557a56614a5b986d0c Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 2 Mar 2011 12:44:46 +0000 Subject: [PATCH] Catch when no host was specified a bit more gracefully. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4308 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rfb/Hostname.h | 2 ++ 1 file changed, 2 insertions(+) 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"); -- 2.39.5