summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-02-14 07:22:28 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2015-02-14 07:22:28 +0100
commit6a9a707a9cc9eddfed909b996e09d624bf657d3c (patch)
treef257bc3c59c8ed0a8e82624421354560d5fa3000 /common.c
parent781bd247805ff75f568d0224190580a762f44074 (diff)
downloadxK-6a9a707a9cc9eddfed909b996e09d624bf657d3c.tar.gz
xK-6a9a707a9cc9eddfed909b996e09d624bf657d3c.tar.xz
xK-6a9a707a9cc9eddfed909b996e09d624bf657d3c.zip
Avoid null pointer dereference
In irc_listen_resolve() with NULL `host'.
Diffstat (limited to 'common.c')
-rw-r--r--common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common.c b/common.c
index 3bbdd78..009d325 100644
--- a/common.c
+++ b/common.c
@@ -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);