mirror of
https://sourceware.org/git/glibc.git
synced 2025-06-06 11:41:02 +03:00
,
* sysdeps/unix/sysv/linux/check_pf.c (make_request): Make sure that unused memory passed to sendto is nevertheless initialized.
This commit is contained in:
parent
acb98cb57d
commit
b74a8c7f5f
@ -1,5 +1,8 @@
|
|||||||
2006-05-06 Ulrich Drepper <drepper@redhat.com>
|
2006-05-06 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/check_pf.c (make_request): Make sure
|
||||||
|
that unused memory passed to sendto is nevertheless initialized.
|
||||||
|
|
||||||
[BZ #2499]
|
[BZ #2499]
|
||||||
* resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Avoid
|
* resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Avoid
|
||||||
possibly unaligned memory accesses.
|
possibly unaligned memory accesses.
|
||||||
|
@ -17,9 +17,11 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -42,10 +44,14 @@ static int
|
|||||||
make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
|
make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
|
||||||
struct in6addrinfo **in6ai, size_t *in6ailen)
|
struct in6addrinfo **in6ai, size_t *in6ailen)
|
||||||
{
|
{
|
||||||
struct
|
struct req
|
||||||
{
|
{
|
||||||
struct nlmsghdr nlh;
|
struct nlmsghdr nlh;
|
||||||
struct rtgenmsg g;
|
struct rtgenmsg g;
|
||||||
|
/* struct rtgenmsg consists of a single byte. This means there
|
||||||
|
are three bytes of padding included in the REQ definition.
|
||||||
|
We make them explicit here. */
|
||||||
|
char pad[3];
|
||||||
} req;
|
} req;
|
||||||
struct sockaddr_nl nladdr;
|
struct sockaddr_nl nladdr;
|
||||||
|
|
||||||
@ -56,6 +62,9 @@ make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
|
|||||||
req.nlh.nlmsg_seq = time (NULL);
|
req.nlh.nlmsg_seq = time (NULL);
|
||||||
req.g.rtgen_family = AF_UNSPEC;
|
req.g.rtgen_family = AF_UNSPEC;
|
||||||
|
|
||||||
|
assert (sizeof (req) - offsetof (struct req, pad) == 3);
|
||||||
|
memset (req.pad, '\0', sizeof (req.pad));
|
||||||
|
|
||||||
memset (&nladdr, '\0', sizeof (nladdr));
|
memset (&nladdr, '\0', sizeof (nladdr));
|
||||||
nladdr.nl_family = AF_NETLINK;
|
nladdr.nl_family = AF_NETLINK;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user