summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
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));