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 7a5ddae..ee0353d 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -1049,7 +1049,7 @@
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;