]> source.dussan.org Git - tigervnc.git/commitdiff
Catch when no host was specified a bit more gracefully.
authorPierre Ossman <ossman@cendio.se>
Wed, 2 Mar 2011 12:44:46 +0000 (12:44 +0000)
committerPierre Ossman <ossman@cendio.se>
Wed, 2 Mar 2011 12:44:46 +0000 (12:44 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4308 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rfb/Hostname.h

index ebdf816f42343e2ef2f09dd32136693b5215187a..f70347f999958c9f490320ae17056464d39acbd7 100644 (file)
@@ -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");