Limits the file size to be sent to INT_MAX 20/256720/2
authorCheoleun Moon <chleun.moon@samsung.com>
Mon, 12 Apr 2021 02:33:17 +0000 (11:33 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Mon, 12 Apr 2021 02:37:03 +0000 (11:37 +0900)
Change-Id: Ia8ff7e3429364f5e645dc987fcf23125199773e6
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
tool/tool_run.cpp

index 43cf194b3efa59bc23020189fd94d379e0a77978..c039d6f79ad29ac487c5b140c877ba3ed848de5e 100644 (file)
@@ -11,6 +11,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <limits.h>
 
 #define RESET_COLOR "\e[m"
 #define MAKE_RED "\e[31m"
@@ -253,7 +254,7 @@ static int _send_message_from_file(vine_dp_h dp)
        fseek(file, 0, SEEK_END);
 
        size = ftell(file);
-       if (size < 0 || size >= SIZE_MAX - 1) {
+       if (size < 0 || size >= INT_MAX - 1) {
                fclose(file);
                return -1;
        }