From c55480eff9eded93c66505a764be7967c3a1dbe6 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 17 Aug 2021 23:33:33 +0200 Subject: [PATCH] Fix memcmp() reading out of bounds in the tinc info command. --- src/info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } } -- 2.20.1