From 9364db9effb37a44e4de8166c00af00e5320c803 Mon Sep 17 00:00:00 2001 From: Nick ODell Date: Mon, 5 Aug 2013 14:46:45 -0600 Subject: Fix bug where handle_NATping wouldn't perform bounds checking --- core/DHT.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/DHT.c') 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) static int handle_NATping(uint8_t * packet, uint32_t length, IP_Port source) { if (length < crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + ENCRYPTION_PADDING - && length > MAX_DATA_SIZE + ENCRYPTION_PADDING) + || length > MAX_DATA_SIZE + ENCRYPTION_PADDING) return 1; /* check if request is for us. */ -- cgit v1.2.3