From 74ee73581a8609952742ebafd2d2d040dc7a1517 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 27 May 2015 17:34:01 +0200 Subject: [PATCH] Fix crash if you pass an invalid hostname Fix #198 --- gns3server/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gns3server/main.py b/gns3server/main.py index e0bf9af2..2d5b27cd 100644 --- a/gns3server/main.py +++ b/gns3server/main.py @@ -186,7 +186,13 @@ def main(): Project.clean_project_directory() CrashReport.instance() - host = server_config["host"] + + try: + host = server_config["host"].encode("idna").decode() + except UnicodeError: + log.critical("Invalid hostname %s", server_config["host"]) + return + port = int(server_config["port"]) server = Server.instance(host, port) try: