Avoid null pointer dereference

In irc_listen_resolve() with NULL `host'.
This commit is contained in:
Přemysl Eric Janouch 2015-02-14 07:22:28 +01:00
parent 781bd24780
commit 6a9a707a9c
1 changed files with 2 additions and 0 deletions

View File

@ -1689,6 +1689,8 @@ xssl_get_error (SSL *ssl, int result, const char **error_info)
static char *
format_host_port_pair (const char *host, const char *port)
{
if (!host)
host = "";
// IPv6 addresses mess with the "colon notation"; let's go with RFC 2732
if (strchr (host, ':'))
return xstrdup_printf ("[%s]:%s", host, port);