Improve ipmask_parse()'s handling of invalid IPv6 inputs.
authorMichael Poole <mdpoole@troilus.org>
Thu, 21 Jun 2012 00:20:25 +0000 (20:20 -0400)
committerMichael Poole <mdpoole@troilus.org>
Thu, 21 Jun 2012 00:20:25 +0000 (20:20 -0400)
ChangeLog
ircd/ircd_string.c

index 254858653f337fcd3abfaab60f7c2e55e126cc45..972cefe2e9c9819bda83adb2a56f8dddec48be99 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-20  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/ircd_string.c (ipmask_parse): Return zero if there is junk
+       after eight valid IPv6 address elements.
+
 2012-06-13  Michael Poole <mdpoole@troilus.org>
 
        * ircd/s_stats.c (stats_configured_links): Correctly distinguish
index b5b32cfc01dacc068e56e674910c6043322d6c4e..f27db15c4b4184bcfba87731b0f0e873b5ce9d14 100644 (file)
@@ -622,6 +622,8 @@ ipmask_parse(const char *input, struct irc_in_addr *ip, unsigned char *pbits)
     default:
       return 0;
     }
+    if (input[pos] != '\0')
+      return 0;
   finish:
     if (colon < 8) {
       unsigned int jj;