From 369c6cb54efab82f2a4fdae003f1ed0f62c41653 Mon Sep 17 00:00:00 2001 From: "startrekkin.net" Date: Mon, 17 Aug 2015 16:33:14 -0400 Subject: [PATCH] If DNS lookup fails, do not check blank hostname for @sitelock --- src/bsd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bsd.c b/src/bsd.c index 5926ad6..e260e99 100644 --- a/src/bsd.c +++ b/src/bsd.c @@ -1255,7 +1255,7 @@ new_connection(int oldsock, int *result, int use_ssl) hi = hostname_convert(&addr.addr, addr_len); safe_str(hi ? hi->hostname : "", tbuf1, &bp); *bp = '\0'; - if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { + if ((*tbuf1 && Forbidden_Site(tbuf1)) || Forbidden_Site(tbuf2)) { if (!Deny_Silent_Site(tbuf1, AMBIGUOUS) || !Deny_Silent_Site(tbuf2, AMBIGUOUS)) { do_log(LT_CONN, 0, 0, "[%d/%s/%s] %s (%s %s)", newsock, tbuf1, tbuf2, @@ -2076,8 +2076,11 @@ reap_info_slave(void) if ((bp2 = strchr(buf, '^'))) { *bp2++ = '\0'; /* buf is ip addr, bp is local port^ident info */ - if ((bp = strchr(bp2, '^'))) + if ((bp = strchr(bp2, '^'))) { *bp++ = '\0'; + if (!*bp) + bp = NULL; + } } /* Now, either buf = ipaddr, bp2 = port, bp = ident info, * or buf = ipaddr, bp2 = port -- 2.30.2