summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-09-01 22:29:51 -0400
committerirungentoo <irungentoo@gmail.com>2013-09-01 22:29:51 -0400
commita1099d7f95591e125c12ba67917b1b9f9bb72933 (patch)
treeee75e0b7d452cae51b417156811d5f8e516513a3 /toxcore/DHT.c
parent86c748e75552bfc5d57d7ae07d45b440000090d2 (diff)
Fixed possible bug.
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 50bddbd6..38552184 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -974,6 +974,9 @@ static int send_NATping(DHT *dht, uint8_t *public_key, uint64_t ping_id, uint8_t
974/* Handle a received ping request for. */ 974/* Handle a received ping request for. */
975static int handle_NATping(void *object, IP_Port source, uint8_t *source_pubkey, uint8_t *packet, uint32_t length) 975static int handle_NATping(void *object, IP_Port source, uint8_t *source_pubkey, uint8_t *packet, uint32_t length)
976{ 976{
977 if (length != sizeof(uint64_t) + 1)
978 return 1;
979
977 DHT *dht = object; 980 DHT *dht = object;
978 uint64_t ping_id; 981 uint64_t ping_id;
979 memcpy(&ping_id, packet + 1, sizeof(uint64_t)); 982 memcpy(&ping_id, packet + 1, sizeof(uint64_t));