summaryrefslogtreecommitdiff
path: root/core/DHT.c
diff options
context:
space:
mode:
authorNick ODell <nickodell@gmail.com>2013-08-05 14:46:45 -0600
committerNick ODell <nickodell@gmail.com>2013-08-05 14:46:45 -0600
commit9364db9effb37a44e4de8166c00af00e5320c803 (patch)
treebb0aaaf2ef682e518d0050d559a9529dc34c1b75 /core/DHT.c
parentf0397ebb2b85100e2ac1b2d3a377ba012ab53240 (diff)
Fix bug where handle_NATping wouldn't perform bounds checking
Diffstat (limited to 'core/DHT.c')
-rw-r--r--core/DHT.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/DHT.c b/core/DHT.c
index 6375b86b..f6c48a6d 100644
--- a/core/DHT.c
+++ b/core/DHT.c
@@ -1108,7 +1108,7 @@ static int send_NATping(uint8_t * public_key, uint64_t ping_id, uint8_t type)
1108static int handle_NATping(uint8_t * packet, uint32_t length, IP_Port source) 1108static int handle_NATping(uint8_t * packet, uint32_t length, IP_Port source)
1109{ 1109{
1110 if (length < crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + ENCRYPTION_PADDING 1110 if (length < crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + ENCRYPTION_PADDING
1111 && length > MAX_DATA_SIZE + ENCRYPTION_PADDING) 1111 || length > MAX_DATA_SIZE + ENCRYPTION_PADDING)
1112 return 1; 1112 return 1;
1113 1113
1114 /* check if request is for us. */ 1114 /* check if request is for us. */