From: Christopher Faulet Date: Wed, 3 Aug 2022 08:30:06 +0000 (+0200) Subject: BUG/MEDIUM: dns: Properly initialize new DNS session X-Git-Tag: v2.7-dev3~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14a60d420a66368a4262e8ecf259781292509659;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: dns: Properly initialize new DNS session When a new DNS session is created, all its fields are not properly initialized. For instance, "tx_msg_offset" can have any value after the allocation. So, to fix the bug, pool_zalloc() is now used to allocate new DNS session. This patch should fix the issue #1781. It must be backported as far as 2.4. --- diff --git a/src/dns.c b/src/dns.c index 7a5ddae980..ee0353d10a 100644 --- a/src/dns.c +++ b/src/dns.c @@ -1049,7 +1049,7 @@ struct dns_session *dns_session_new(struct dns_stream_server *dss) if (dss->maxconn && (dss->maxconn <= dss->cur_conns)) return NULL; - ds = pool_alloc(dns_session_pool); + ds = pool_zalloc(dns_session_pool); if (!ds) return NULL;