]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/phonet/pep.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[karo-tx-linux.git] / net / phonet / pep.c
index 9f60008740e32875fb80d64b070cdf7262366650..9726fe684ab8a35ded1f1acb9ae4ea0dbdbe6b12 100644 (file)
@@ -1130,6 +1130,9 @@ static int pep_sendmsg(struct kiocb *iocb, struct sock *sk,
        int flags = msg->msg_flags;
        int err, done;
 
+       if (len > USHRT_MAX)
+               return -EMSGSIZE;
+
        if ((msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_NOSIGNAL|
                                MSG_CMSG_COMPAT)) ||
                        !(msg->msg_flags & MSG_EOR))