Skip to content

Commit

Permalink
Truncate size to 32 bit
Browse files Browse the repository at this point in the history
Presuming that the size of the block will never exceed 4GB, I truncate the
64 bit size_t down to a 32 bit number.
  • Loading branch information
Bart Joy committed Jul 22, 2018
1 parent cdad86c commit 528badd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TcpConnectionKiller/TcpConnectionKiller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ vector<MIB_TCPROW2> GetConnectionsFromProcess(int processIdToKill)
{
auto tableMemory = vector<uint8_t>(1000000);
const auto table = reinterpret_cast<MIB_TCPTABLE2*>(&tableMemory[0]);
ULONG size = tableMemory.size();
ULONG size = static_cast<ULONG>(tableMemory.size());
if (GetTcpTable2(table, &size, TRUE) != 0)
{
throw exception("Failed to get TCP table");
Expand Down

0 comments on commit 528badd

Please sign in to comment.