From 0adaf13438d04bcf9fed46fa33cedc658838b1f6 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Thu, 21 Nov 2024 15:18:19 +0000 Subject: [PATCH] Don't clear tcpfd for literal address server records. They have smaller structs which don't include that field, so this is a buffer overlow. Error introduced in f5cdb007d8845dde8e5053229f47b46b1b756473 --- src/domain-match.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/domain-match.c b/src/domain-match.c index 2527b52..3b7b60e 100644 --- a/src/domain-match.c +++ b/src/domain-match.c @@ -739,13 +739,14 @@ int add_update_server(int flags, serv->addr = *addr; if (source_addr) serv->source_addr = *source_addr; + + serv->tcpfd = -1; } serv->flags = flags; serv->domain = alloc_domain; serv->domain_len = strlen(alloc_domain); - serv->tcpfd = -1; - + return 1; }