From 5273414bf49587dc039dc02ec5bb5a8ea298de3f Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 13 Jan 2015 19:01:45 +0000 Subject: [PATCH] - scan.c:scan_manual(): replaced inet_ntoa() with inet_ntop() git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@5375 82007160-df01-0410-b94d-b575c5fd34c7 --- src/scan.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/scan.c b/src/scan.c index 7cd76ad..acbe99c 100644 --- a/src/scan.c +++ b/src/scan.c @@ -861,10 +861,11 @@ scan_irckline(const struct scan_struct *ss, const char *format, const char *type void scan_manual(char *param, const struct ChannelConf *target) { - struct in_addr *addr; + char buf[INET6_ADDRSTRLEN]; + const void *addr = NULL; struct scan_struct *ss; struct scanner_struct *scs; - char *ip; + const char *ip = NULL; char *scannername; node_t *p; int ret; @@ -897,7 +898,11 @@ scan_manual(char *param, const struct ChannelConf *target) } /* IP = the resolved IP now (it was the ip OR hostname before) */ - ip = inet_ntoa(*addr); + if ((ip = inet_ntop(AF_INET, addr, buf, sizeof(buf))) == NULL) + { + irc_send("PRIVMSG %s :CHECK -> invalid address: %s", strerror(errno)); + return; + } ss = xcalloc(sizeof *ss); ss->ip = xstrdup(ip); -- 2.30.2