]> granicus.if.org Git - libnl/commitdiff
nl_recv(): Zero out sockaddr in case the caller forgot
authorThomas Graf <tgraf@suug.ch>
Mon, 22 Nov 2010 13:19:40 +0000 (14:19 +0100)
committerThomas Graf <tgraf@suug.ch>
Mon, 22 Nov 2010 13:19:40 +0000 (14:19 +0100)
lib/nl.c

index 5616dcc985e6f2239a6a67baafe6ef523350fc04..8f6f5f12287a15038762dabab21f9d7869f86e53 100644 (file)
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -427,6 +427,8 @@ int nl_recv(struct nl_sock *sk, struct sockaddr_nl *nla,
        };
        struct cmsghdr *cmsg;
 
+       memset(nla, 0, sizeof(*nla));
+
        if (sk->s_flags & NL_MSG_PEEK)
                flags |= MSG_PEEK;