]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Fix] Fix TCP DNS uninitialized memory leak 5716/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 29 Oct 2025 13:45:38 +0000 (13:45 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 29 Oct 2025 13:46:24 +0000 (13:46 +0000)
commit2345de9a97fbd8e1224a1e4435590738bb66938e
tree653195fd2b49159ee2f2649f79fd046c341a32a1
parent308093c7beeb6e476e28681cdf3f13da106b9770
[Fix] Fix TCP DNS uninitialized memory leak

When rescheduling a DNS request from UDP to TCP, the code was using
req->packet_len (allocated buffer size) instead of req->pos (actual
packet size) to copy and send the DNS packet. This caused random
garbage from uninitialized memory to be appended to TCP DNS queries.

The bug was particularly noticeable with short queries like TXT records,
where the allocated buffer could be 2-3x larger than the actual packet.
contrib/librdns/resolver.c