A DNS query recieved by UDP which exceeds 512 bytes (or the EDNS0 packet size,
if different.) is enough to cause SIGSEGV.
http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=
63437ffbb58837b214b4b92cb1c54bc5f3279928
Change-Id: I93a69c8e308479c0abcd64eea071473419d80946
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
(msg.msg_flags & MSG_TRUNC) ||
(header->hb3 & HB3_QR))
return;
+
+ /* Clear buffer beyond request to avoid risk of
+ information disclosure. */
+ memset(daemon->packet + n, 0, daemon->edns_pktsz - n);
source_addr.sa.sa_family = listen->family;
if (size < (int)sizeof(struct dns_header))
continue;
+
+ /* Clear buffer beyond request to avoid risk of
+ information disclosure. */
+ memset(payload + size, 0, 65536 - size);
query_count++;