From 5487f6979e51aeb4ef6aa8152aada78bbe774ba1 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Thu, 20 Feb 2025 23:27:24 +0000 Subject: [PATCH] Fix (benign) use of uninitialised data. --- src/rfc1035.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/rfc1035.c b/src/rfc1035.c index cd18618..883b93d 100644 --- a/src/rfc1035.c +++ b/src/rfc1035.c @@ -596,18 +596,18 @@ static int find_soa(struct dns_header *header, size_t qlen, char *name, int *sub } /* rest of RR */ - if (!no_cache && !blockdata_expand(addr.rrblock.rrdata, addr.rrblock.datalen, (char *)p, 20)) - { - blockdata_free(addr.rrblock.rrdata); - return 0; - } - - addr.rrblock.datalen += 20; - if (!no_cache) { int secflag = 0; + if (!blockdata_expand(addr.rrblock.rrdata, addr.rrblock.datalen, (char *)p, 20)) + { + blockdata_free(addr.rrblock.rrdata); + return 0; + } + + addr.rrblock.datalen += 20; + #ifdef HAVE_DNSSEC if (option_bool(OPT_DNSSEC_VALID) && daemon->rr_status[i + ntohs(header->ancount)] != 0) {