From 2cf13869e6194d21a1f245aa251b33cb03b77bb6 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Wed, 20 Jun 2012 20:20:25 -0400 Subject: [PATCH] Improve ipmask_parse()'s handling of invalid IPv6 inputs. --- ChangeLog | 5 +++++ ircd/ircd_string.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2548586..972cefe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-06-20 Michael Poole + + * ircd/ircd_string.c (ipmask_parse): Return zero if there is junk + after eight valid IPv6 address elements. + 2012-06-13 Michael Poole * ircd/s_stats.c (stats_configured_links): Correctly distinguish diff --git a/ircd/ircd_string.c b/ircd/ircd_string.c index b5b32cf..f27db15 100644 --- a/ircd/ircd_string.c +++ b/ircd/ircd_string.c @@ -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; -- 2.20.1