return;
}
udp = payload;
+ if (udp->len < sizeof (struct GNUNET_TUN_UdpHeader))
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
spt = ntohs (udp->spt);
dpt = ntohs (udp->dpt);
get_tunnel_key_from_ips (af,
return;
}
tcp = payload;
+ if (tcp->off * 4 < sizeof (struct GNUNET_TUN_TcpHeader))
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
spt = ntohs (tcp->spt);
dpt = ntohs (tcp->dpt);
get_tunnel_key_from_ips (af,
inet_ntop (ts->af, &ts->source_ip, dbuf, sizeof (dbuf)),
ts->source_port);
}
+ if (data->tcp_header.off * 4 < sizeof (struct GNUNET_TUN_TcpHeader))
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
switch (ts->af)
{
case AF_INET: