From 3f96acb665602773de20f9e03ca1cb44e4d82f0d Mon Sep 17 00:00:00 2001 From: venaas Date: Mon, 25 Feb 2008 10:41:20 +0000 Subject: max logging not crash when resolvepeer fails git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@217 e88ac4ed-0b26-0410-9574-a7f39faa03bf --- radsecproxy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radsecproxy.c b/radsecproxy.c index f6cbaa1..c0e5422 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -187,7 +187,7 @@ int resolvepeer(struct clsrvconf *conf, int ai_flags) { if (slash) hints.ai_flags |= AI_NUMERICHOST; if (getaddrinfo(conf->host, conf->port, &hints, &addrinfo)) { - debug(DBG_WARN, "resolvepeer: can't resolve %s port %s", conf->host, conf->port); + debug(DBG_WARN, "resolvepeer: can't resolve %s port %s", conf->host ? conf->host : "(null)", conf->port ? conf->port : "(null)"); return 0; } if (slash) { @@ -299,7 +299,7 @@ struct clsrvconf *resolve_hostport(char type, char *lconf, char *default_port) { } else conf->port = default_port ? stringcopy(default_port, 0) : NULL; if (!resolvepeer(conf, AI_PASSIVE)) - debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host, conf->port); + debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host ? conf->host : "(null)", conf->port ? conf->port : "(null)"); return conf; } @@ -2577,7 +2577,7 @@ void confclient_cb(struct gconffile **cf, char *block, char *opt, char *val) { } if (!resolvepeer(conf, 0)) - debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host, conf->port); + debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host ? conf->host : "(null)", conf->port ? conf->port : "(null)"); if (!conf->secret) { if (conf->type == 'U') @@ -2636,7 +2636,7 @@ void confserver_cb(struct gconffile **cf, char *block, char *opt, char *val) { free(matchcertattr); if (!resolvepeer(conf, 0)) - debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host, conf->port); + debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host ? conf->host : "(null)", conf->port ? conf->port : "(null)"); if (!conf->secret) { if (conf->type == 'U') -- cgit v1.1