diff options
author | Linus Nordberg <linus@nordu.net> | 2016-10-17 08:52:33 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2016-10-17 09:04:30 +0200 |
commit | 6a45e6949917c62aeae74c65cadcaf82df9e135f (patch) | |
tree | a06936912b89cc2c08588159e897047af8f2e559 | |
parent | e901dd8cf7f762ed12b440d5ee46e953efa50bbb (diff) |
Don't follow the NULL pointer, not even in debug printouts.
Bug reported by Leonhard Knauff.
Closes RADSECPROXY-68.
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | hostport.c | 5 |
2 files changed, 5 insertions, 1 deletions
@@ -13,6 +13,7 @@ Fabian Mauchle Faidon Liambotis Hans Zandbelt Kolbjørn Barmen +Leonhard Knauff Linus Nordberg Luke Benes Maja Wolniewicz @@ -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: |