projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enable compiler hardening flags by default.
[tinc]
/
src
/
net_packet.c
diff --git
a/src/net_packet.c
b/src/net_packet.c
index
1efc60d
..
81d0572
100644
(file)
--- a/
src/net_packet.c
+++ b/
src/net_packet.c
@@
-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;
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;
outpkt.len = len;
if(c->options & OPTION_TCPONLY)
outpkt.priority = 0;
@@
-647,7
+650,7
@@
void broadcast_packet(const node_t *from, vpn_packet_t *packet) {
for(node = node_udp_tree->head; node; node = node->next) {
n = node->data;
for(node = node_udp_tree->head; node; node = node->next) {
n = node->data;
- if(n->status.reachable && ((n->via == myself && n->nexthop == n) || n->via == n))
+ if(n->status.reachable &&
n != myself &&
((n->via == myself && n->nexthop == n) || n->via == n))
send_packet(n, packet);
}
break;
send_packet(n, packet);
}
break;