]> jfr.im git - irc/quakenet/newserv.git/commitdiff
sync http://hg.quakenet.org/snircd/diff/6a655306abe8/ircd/ircd_string.c
authorPaul <redacted>
Wed, 24 Dec 2008 18:15:56 +0000 (18:15 +0000)
committerPaul <redacted>
Wed, 24 Dec 2008 18:15:56 +0000 (18:15 +0000)
lib/irc_ipv6.c

index 23720a3629902049549d8c575ea0d7f0cbc2c28d..0a4d6215458c89377097f8525b2937b72cdcbbef 100644 (file)
@@ -106,9 +106,11 @@ ircd_aton_ip4(const char *input, unsigned int *output, unsigned char *pbits)
       *pbits = bits;
     return pos;
   case '.':
+    if (++dots > 3)
+      return 0;
     if (input[++pos] == '.')
       return 0;
-    ip |= part << (24 - 8 * dots++);
+    ip |= part << (32 - 8 * dots);
     part = 0;
     if (input[pos] == '*') {
       while (input[++pos] == '*') ;