From e54e71fb6bb0f76bf73b540580abd0a5c5c8539d Mon Sep 17 00:00:00 2001 From: "teor (Tim Wilson-Brown)" Date: Wed, 16 Dec 2015 08:48:32 +1100 Subject: Limit IPv6 mask bits to 128 --- src/common/address.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/common/address.c') diff --git a/src/common/address.c b/src/common/address.c index 627764153b..69a80986ed 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -1039,6 +1039,8 @@ tor_addr_compare_masked(const tor_addr_t *addr1, const tor_addr_t *addr2, return r; } case AF_INET6: { + if (mbits > 128) + mbits = 128; const uint8_t *a1 = tor_addr_to_in6_addr8(addr1); const uint8_t *a2 = tor_addr_to_in6_addr8(addr2); const int bytes = mbits >> 3; -- cgit v1.2.3-54-g00ecf