Drop packets forwarded via TCP if they are too big (CVE-2013-1428).
[oweals/tinc.git] / src / net_packet.c
index 1efc60dd76b4455660b79ea3ee8d24e228380c14..054679e9aa0c75bca437e96443336a21d7ee53e4 100644 (file)
@@ -394,6 +394,9 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
 void receive_tcppacket(connection_t *c, const char *buffer, int len) {
        vpn_packet_t outpkt;
 
+       if(len > sizeof outpkt.data)
+               return;
+
        outpkt.len = len;
        if(c->options & OPTION_TCPONLY)
                outpkt.priority = 0;