From: Adam Dickmeiss Date: Tue, 17 Jan 2012 13:55:54 +0000 (+0100) Subject: Fix 0 ptr ref in tcpd usage (host unknown) X-Git-Tag: v4.2.26~3 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=d1ea8fe378111656d531fb426eaa10f57d56f29f;p=yaz-moved-to-github.git Fix 0 ptr ref in tcpd usage (host unknown) Thanks to Donovan Artz for the patch. --- diff --git a/src/tcpdchk.c b/src/tcpdchk.c index 195938b..1d83211 100644 --- a/src/tcpdchk.c +++ b/src/tcpdchk.c @@ -74,15 +74,14 @@ int check_ip_tcpd(void *cd, const char *addr, int len, int type) AF_INET))) host_name = (char*) host->h_name; host_addr = inet_ntoa(addr_in->sin_addr); - if (host_addr) + if (host_addr && host_name) request_init(&request_info, RQ_DAEMON, daemon_name, RQ_CLIENT_NAME, host_name, RQ_CLIENT_SIN, addr_in, RQ_CLIENT_ADDR, host_addr, 0); else request_init(&request_info, RQ_DAEMON, daemon_name, - RQ_CLIENT_SIN, addr_in, - RQ_CLIENT_ADDR, host_addr, 0); + RQ_CLIENT_SIN, addr_in, 0); i = hosts_access(&request_info); if (!i) {