summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toxcore/DHT.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 94168a69..9d5be369 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -982,6 +982,9 @@ static int send_NATping(DHT *dht, uint8_t *public_key, uint64_t ping_id, uint8_t
982/* Handle a received ping request for. */ 982/* Handle a received ping request for. */
983static int handle_NATping(void *object, IP_Port source, uint8_t *source_pubkey, uint8_t *packet, uint32_t length) 983static int handle_NATping(void *object, IP_Port source, uint8_t *source_pubkey, uint8_t *packet, uint32_t length)
984{ 984{
985 if (length != sizeof(uint64_t) + 1)
986 return 1;
987
985 DHT *dht = object; 988 DHT *dht = object;
986 uint64_t ping_id; 989 uint64_t ping_id;
987 memcpy(&ping_id, packet + 1, sizeof(uint64_t)); 990 memcpy(&ping_id, packet + 1, sizeof(uint64_t));