In dnsmasq before 2.78, if the DNS packet size does not match the expected size, the size parameter in a memset call gets a negative value. As it is an unsigned value, memset ends up writing up to 0xffffffff zero's (0xffffffffffffffff in 64 bit platforms), making dnsmasq crash.
https://www.synology.com/support/security/Synology_SA_17_59_Dnsmasq
https://www.mail-archive.com/dnsmasq-discuss%40lists.thekelleys.org.uk/msg11665.html
https://www.mail-archive.com/dnsmasq-discuss%40lists.thekelleys.org.uk/msg11664.html
https://security.googleblog.com/2017/10/behind-masq-yet-more-dns-and-dhcp.html
https://cert-portal.siemens.com/productcert/pdf/ssa-689071.pdf
https://access.redhat.com/security/vulnerabilities/3199382
http://www.securitytracker.com/id/1039474
http://www.securityfocus.com/bid/101977