]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/x25/af_x25.c
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / net / x25 / af_x25.c
index 9ca17b1ce52e8191f04b401e2f0a1e021062badf..ed80af8ca5fb86f018c2421467d497d084fe73ba 100644 (file)
@@ -1035,6 +1035,12 @@ static int x25_sendmsg(struct kiocb *iocb, struct socket *sock,
                sx25.sx25_addr   = x25->dest_addr;
        }
 
+       /* Sanity check the packet size */
+       if (len > 65535) {
+               rc = -EMSGSIZE;
+               goto out;
+       }
+
        SOCK_DEBUG(sk, "x25_sendmsg: sendto: Addresses built.\n");
 
        /* Build a packet */