diff options
-rw-r--r-- | toxcore/Lossless_UDP.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/toxcore/Lossless_UDP.c b/toxcore/Lossless_UDP.c index 7c838510..270b4b35 100644 --- a/toxcore/Lossless_UDP.c +++ b/toxcore/Lossless_UDP.c | |||
@@ -703,7 +703,10 @@ static int handle_data(void *object, IP_Port source, uint8_t *packet, uint32_t l | |||
703 | int connection_id = getconnection_id(ludp, source); | 703 | int connection_id = getconnection_id(ludp, source); |
704 | 704 | ||
705 | /* Drop the data packet if connection is not connected. */ | 705 | /* Drop the data packet if connection is not connected. */ |
706 | if (connection_id == -1 || tox_array_get(&ludp->connections, connection_id, Connection).status != 3) | 706 | if (connection_id == -1) |
707 | return 1; | ||
708 | |||
709 | if (tox_array_get(&ludp->connections, connection_id, Connection).status != 3) | ||
707 | return 1; | 710 | return 1; |
708 | 711 | ||
709 | if (length > 1 + 4 + MAX_DATA_SIZE || length < 1 + 4 + 1) | 712 | if (length > 1 + 4 + MAX_DATA_SIZE || length < 1 + 4 + 1) |