mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 02:08:24 +00:00
46288c7e9034bf1b4f3dc6398a3cf1e61e66816e
The msg_controllen field passed to sendmsg is computed using the CMSG_SPACE(), which is correct, but CMSG_SPACE() can include padding bytes at the end of the passed structure if they are required to align subsequent structures in the buffer. Make sure these bytes are zeroed to avoid passing uninitiased memory to the kernel, even though it will never touch these bytes. Also tidy up the mashalling code in send_from to use pointers to the structure being filled out, rather than a temporary copy which then gets memcpy()'d into place. The DHCP sendmsg code has always worked like this. Thanks to Dominik Derigs for running Memcheck as submitting the initial patch.
Description
No description provided
Languages
C
94.2%
Perl
2.3%
HTML
1.2%
Shell
1.1%
Makefile
0.6%
Other
0.6%