[tor-commits] [tor/master] Limit IPv6 mask bits to 128
nickm at torproject.org
nickm at torproject.org
Wed Dec 16 13:51:00 UTC 2015
commit e54e71fb6bb0f76bf73b540580abd0a5c5c8539d
Author: teor (Tim Wilson-Brown) <teor2345 at gmail.com>
Date: Wed Dec 16 08:48:32 2015 +1100
Limit IPv6 mask bits to 128
---
src/common/address.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/common/address.c b/src/common/address.c
index 6277641..69a8098 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;
More information about the tor-commits
mailing list