From 528badd1b72cb59dba1df0ed8dc8f12c5bc24dc7 Mon Sep 17 00:00:00 2001 From: Bart Joy Date: Mon, 23 Jul 2018 11:06:52 +1200 Subject: [PATCH] Truncate size to 32 bit Presuming that the size of the block will never exceed 4GB, I truncate the 64 bit size_t down to a 32 bit number. --- TcpConnectionKiller/TcpConnectionKiller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TcpConnectionKiller/TcpConnectionKiller.cpp b/TcpConnectionKiller/TcpConnectionKiller.cpp index e9bfd60..3f17e43 100644 --- a/TcpConnectionKiller/TcpConnectionKiller.cpp +++ b/TcpConnectionKiller/TcpConnectionKiller.cpp @@ -40,7 +40,7 @@ vector GetConnectionsFromProcess(int processIdToKill) { auto tableMemory = vector(1000000); const auto table = reinterpret_cast(&tableMemory[0]); - ULONG size = tableMemory.size(); + ULONG size = static_cast(tableMemory.size()); if (GetTcpTable2(table, &size, TRUE) != 0) { throw exception("Failed to get TCP table");