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.
This commit is contained in:
parent
642170a653
commit
14a60d420a
|
@ -1049,7 +1049,7 @@ struct dns_session *dns_session_new(struct dns_stream_server *dss)
|
||||||
if (dss->maxconn && (dss->maxconn <= dss->cur_conns))
|
if (dss->maxconn && (dss->maxconn <= dss->cur_conns))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ds = pool_alloc(dns_session_pool);
|
ds = pool_zalloc(dns_session_pool);
|
||||||
if (!ds)
|
if (!ds)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue