From: Pierre Ossman Date: Wed, 2 Mar 2011 12:44:46 +0000 (+0000) Subject: Catch when no host was specified a bit more gracefully. X-Git-Tag: v1.1.90~442 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3270a59ae45a88054e8e18557a56614a5b986d0c;p=tigervnc.git 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 --- 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");