From 6a45e6949917c62aeae74c65cadcaf82df9e135f Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Mon, 17 Oct 2016 08:52:33 +0200 Subject: Don't follow the NULL pointer, not even in debug printouts. Bug reported by Leonhard Knauff. Closes RADSECPROXY-68. --- AUTHORS | 1 + hostport.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index e3eb815..d2aee35 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,6 +13,7 @@ Fabian Mauchle Faidon Liambotis Hans Zandbelt Kolbjørn Barmen +Leonhard Knauff Linus Nordberg Luke Benes Maja Wolniewicz diff --git a/hostport.c b/hostport.c index 678a9c5..961edb9 100644 --- a/hostport.c +++ b/hostport.c @@ -163,7 +163,10 @@ int resolvehostport(struct hostportres *hp, int af, int socktype, uint8_t passiv } } } - debug(DBG_DBG, "%s: %s -> %s", __func__, hp->host, addr2string(hp->addrinfo->ai_addr)); + debug(DBG_DBG, "%s: %s -> %s", __func__, + (hp->host ? hp->host : "(src info not available)"), + ((hp->addrinfo && hp->addrinfo->ai_addr) ? + addr2string(hp->addrinfo->ai_addr) : "(dst info not available)")); return 1; errexit: -- cgit v1.1