- scan.c:scan_manual(): replaced inet_ntoa() with inet_ntop()
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Tue, 13 Jan 2015 19:01:45 +0000 (19:01 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Tue, 13 Jan 2015 19:01:45 +0000 (19:01 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@5375 82007160-df01-0410-b94d-b575c5fd34c7

src/scan.c

index 7cd76ad184e1ffa7a873ded26bea47e3bc53f565..acbe99cd5ee7cb17cdc6bf5f80b9bd1690aad505 100644 (file)
@@ -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);