summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-16 08:48:32 +1100
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-12-16 08:51:34 +1100
commite54e71fb6bb0f76bf73b540580abd0a5c5c8539d (patch)
treeb000596af069adf4796aa7b1bf25f76b7b2231af
parent6ba8afe5f87a1edd16f4c61cbb59a29f9126c6c6 (diff)
downloadtor-e54e71fb6bb0f76bf73b540580abd0a5c5c8539d.tar.gz
tor-e54e71fb6bb0f76bf73b540580abd0a5c5c8539d.zip
Limit IPv6 mask bits to 128
-rw-r--r--src/common/address.c2
1 files changed, 2 insertions, 0 deletions
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;