From: Guus Sliepen Date: Tue, 17 Aug 2021 21:33:33 +0000 (+0200) Subject: Fix memcmp() reading out of bounds in the tinc info command. X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=c55480eff9eded93c66505a764be7967c3a1dbe6;p=tinc Fix memcmp() reading out of bounds in the tinc info command. --- diff --git a/src/info.c b/src/info.c index 1649be06..c324df94 100644 --- a/src/info.c +++ b/src/info.c @@ -297,7 +297,7 @@ static int info_subnet(int fd, const char *item) { continue; } - if(memcmp(&find.net.ipv4.address, &subnet.net.ipv4.address, sizeof(subnet.net.ipv4))) { + if(memcmp(&find.net.ipv4.address, &subnet.net.ipv4.address, sizeof(subnet.net.ipv4.address))) { continue; } } @@ -311,14 +311,14 @@ static int info_subnet(int fd, const char *item) { continue; } - if(memcmp(&find.net.ipv6.address, &subnet.net.ipv6.address, sizeof(subnet.net.ipv6))) { + if(memcmp(&find.net.ipv6.address, &subnet.net.ipv6.address, sizeof(subnet.net.ipv6.address))) { continue; } } } if(find.type == SUBNET_MAC) { - if(memcmp(&find.net.mac.address, &subnet.net.mac.address, sizeof(subnet.net.mac))) { + if(memcmp(&find.net.mac.address, &subnet.net.mac.address, sizeof(subnet.net.mac.address))) { continue; } }