From 1bc9eb46a027326dcdc7622e2ad9874f5e9c4ab8 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 1 Dec 2020 22:17:33 +0100 Subject: [PATCH] Tweak code to restore compatibility with Gentoo gcc 10.2.0-r3 Signed-off-by: DL6ER --- src/dnsmasq_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dnsmasq_interface.c b/src/dnsmasq_interface.c index 340aed1c8..c97b68d26 100644 --- a/src/dnsmasq_interface.c +++ b/src/dnsmasq_interface.c @@ -551,12 +551,12 @@ bool _FTL_new_query(const unsigned int flags, const char *name, // 127.0.0.1 to avoid queries originating from localhost of the // *distant* machine as queries coming from the *local* machine const sa_family_t family = (flags & F_IPV4) ? AF_INET : AF_INET6; - char clientIP[ADDRSTRLEN] = { 0 }; + char clientIP[ADDRSTRLEN+1] = { 0 }; if(config.edns0_ecs && edns->client_set) { // Use ECS provided client strncpy(clientIP, edns->client, ADDRSTRLEN); - clientIP[ADDRSTRLEN-1] = '\0'; + clientIP[ADDRSTRLEN] = '\0'; } else {