summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2016-10-17 08:52:33 +0200
committerLinus Nordberg <linus@nordu.net>2017-08-02 13:09:43 +0200
commit32d58a5276927892c16f17b3f5676fa0a067c19a (patch)
tree01ff59959dda74195e96aa4d36b97ecd558324cf
parent950306fca00af2ea68f21e7873a227694559cb95 (diff)
Don't follow the NULL pointer, not even in debug printouts.
Bug reported by Leonhard Knauff. Closes RADSECPROXY-68.
-rw-r--r--AUTHORS1
-rw-r--r--ChangeLog1
-rw-r--r--hostport.c5
3 files changed, 6 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index 0e0436a..daaa5ce 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -13,6 +13,7 @@ Fabian Mauchle
Faidon Liambotis
Hans Zandbelt
Kolbjørn Barmen
+Leonhard Knauff
Linus Nordberg
Maja Wolniewicz
Milan Sova
diff --git a/ChangeLog b/ChangeLog
index 10b294c..e3873f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
- Use a listen(2) backlog of 128 (RADSECPROXY-72).
Bug fixes:
+ - Don't follow NULL the pointer at debug level 5 (RADSECPROXY-68).
- Completely reload CAs and CRLs with cacheExpiry (RADSECPROXY-50).
- Tie Access-Request log lines to response log lines (RADSECPROXY-60).
- Fix a couple of memory leaks and NULL ptr derefs in error cases.
diff --git a/hostport.c b/hostport.c
index 4214c55..0c197fe 100644
--- a/hostport.c
+++ b/hostport.c
@@ -172,7 +172,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: