From: Willy Tarreau Date: Tue, 19 Oct 2021 09:29:21 +0000 (+0200) Subject: CLEANUP: always initialize the answer_list X-Git-Tag: v2.3.15~25 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=10fec734c9fc9f070de3b856bb90906eadcc4fa3;p=haproxy-2.3.git CLEANUP: always initialize the answer_list Similar to the previous patch, the answer's list was only initialized the first time it was added to a list, leading to bogus outdated pointer to appear when debugging code is added around it to watch it. Let's make sure it's always initialized upon allocation. (cherry picked from commit 48664c048d17486b80e58459d2d4fa41a36e579e) Signed-off-by: Willy Tarreau (cherry picked from commit a2373e82f574fdba5fb52ff0ef917b16dd44484a) Signed-off-by: Christopher Faulet --- diff --git a/src/dns.c b/src/dns.c index 1c62106..dee243d 100644 --- a/src/dns.c +++ b/src/dns.c @@ -1067,6 +1067,7 @@ static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend, dns_answer_record->ar_item = NULL; dns_answer_record->last_seen = TICK_ETERNITY; LIST_INIT(&dns_answer_record->attached_servers); + LIST_INIT(&dns_answer_record->list); offset = 0; len = dns_read_name(resp, bufend, reader, tmpname, DNS_MAX_NAME_SIZE, &offset, 0);