From a3ea1452906989994d8d27830df754c8117edcd7 Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Wed, 8 Sep 2021 17:26:20 +0200 Subject: Add ULL postfix to FILE_SIZE_THRESHOLD to avoid using int Otherwise, cli->size > FILE_SIZE_THRESHOLD uses 32-bit integer which overflows with very large files. Use ULL to enforce 64-bits. --- src/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.h b/src/core.h index 524dd62..d39eda4 100644 --- a/src/core.h +++ b/src/core.h @@ -14,7 +14,7 @@ extern int max_clients; extern int num_clients; extern bool redirect; /* max_client logic only applies for files larger than 1024 bytes. */ -#define FILE_SIZE_THRESHOLD 1024 +#define FILE_SIZE_THRESHOLD 1024ULL enum tip_client_state { TIP_CLIENT_PENDING = 0, -- cgit v1.2.3-18-g5258