]> granicus.if.org Git - libnl/commitdiff
nl_recv: return NLE_INVAL if buf is NULL
authorThomas Graf <tgraf@redhat.com>
Tue, 6 Nov 2012 13:22:50 +0000 (14:22 +0100)
committerThomas Graf <tgraf@redhat.com>
Tue, 6 Nov 2012 13:22:50 +0000 (14:22 +0100)
lib/nl.c

index f4141e7ae2f3f44d7147c95e2bcab03e6fe2baba..17bd8340e04ad7ad8d8c058bc164de85ce8d16b6 100644 (file)
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -464,6 +464,9 @@ int nl_recv(struct nl_sock *sk, struct sockaddr_nl *nla,
        struct ucred* tmpcreds = NULL;
        int retval = 0;
 
+       if (!buf)
+               return -NLE_INVAL;
+
        if (sk->s_flags & NL_MSG_PEEK)
                flags |= MSG_PEEK | MSG_TRUNC;