Skip to content

Commit

Permalink
* sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_sendreq): Make sure
Browse files Browse the repository at this point in the history
	no uninitialized memory is passed to sendto.
  • Loading branch information
Ulrich Drepper committed May 19, 2006
1 parent f90de83 commit 429bb18
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2006-05-19 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_sendreq): Make sure
no uninitialized memory is passed to sendto.

2006-05-18 Ulrich Drepper <drepper@redhat.com>

* nis/nis_callback.c (__nis_create_callback): Use asprinf instead
Expand Down
5 changes: 4 additions & 1 deletion sysdeps/unix/sysv/linux/ifaddrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ __netlink_free_handle (struct netlink_handle *h)
static int
__netlink_sendreq (struct netlink_handle *h, int type)
{
struct
struct req
{
struct nlmsghdr nlh;
struct rtgenmsg g;
char pad[0];
} req;
struct sockaddr_nl nladdr;

Expand All @@ -105,6 +106,8 @@ __netlink_sendreq (struct netlink_handle *h, int type)
req.nlh.nlmsg_pid = 0;
req.nlh.nlmsg_seq = h->seq;
req.g.rtgen_family = AF_UNSPEC;
if (sizeof (req) != offsetof (struct req, pad))
memset (req.pad, '\0', sizeof (req) - offsetof (struct req, pad));

memset (&nladdr, '\0', sizeof (nladdr));
nladdr.nl_family = AF_NETLINK;
Expand Down

0 comments on commit 429bb18

Please sign in to comment.