nl_recv: return NLE_INVAL if buf is NULL

This commit is contained in:
Thomas Graf 2012-11-06 14:22:50 +01:00
parent fb42f19e2e
commit eb36066909

View file

@ -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;