summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-07-15 13:39:32 -0400
committerirungentoo <irungentoo@gmail.com>2014-07-15 13:39:32 -0400
commitae7a11cae9e220ce0a66bc48977104495759a01a (patch)
treefbf0c4e7b5a822f3d0a59c5db2f0dfa77972db26 /toxcore
parent078d60ab929ca7ba50ba9e7de5745456c6114352 (diff)
Fixed TCP bug.
Packet was being copied with a wrong, smaller length.
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/TCP_client.c2
-rw-r--r--toxcore/TCP_server.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c
index 2a2289b2..dbcae11b 100644
--- a/toxcore/TCP_client.c
+++ b/toxcore/TCP_client.c
@@ -165,7 +165,7 @@ static int write_packet_TCP_secure_connection(TCP_Client_Connection *con, const
165 if ((unsigned int)len == sizeof(packet)) 165 if ((unsigned int)len == sizeof(packet))
166 return 1; 166 return 1;
167 167
168 memcpy(con->last_packet, packet, length); 168 memcpy(con->last_packet, packet, sizeof(packet));
169 con->last_packet_length = sizeof(packet); 169 con->last_packet_length = sizeof(packet);
170 con->last_packet_sent = len; 170 con->last_packet_sent = len;
171 return 1; 171 return 1;
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c
index 6c0133dd..e7ef0d3a 100644
--- a/toxcore/TCP_server.c
+++ b/toxcore/TCP_server.c
@@ -345,7 +345,7 @@ static int write_packet_TCP_secure_connection(TCP_Secure_Connection *con, const
345 if ((unsigned int)len == sizeof(packet)) 345 if ((unsigned int)len == sizeof(packet))
346 return 1; 346 return 1;
347 347
348 memcpy(con->last_packet, packet, length); 348 memcpy(con->last_packet, packet, sizeof(packet));
349 con->last_packet_length = sizeof(packet); 349 con->last_packet_length = sizeof(packet);
350 con->last_packet_sent = len; 350 con->last_packet_sent = len;
351 return 1; 351 return 1;