summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheinrich5991 <heinrich5991@gmail.com>2016-05-23 16:17:07 +0200
committeroy <Tom_Adams@web.de>2016-06-13 09:14:41 +0200
commit7dd463d1178e0c1277b5ae6cf0841a0f68e2408b (patch)
treea1d6ceb9c8b02e9e4f793b570153a452152ac43a
parent093c1f15db409efbcbb143312f2543c2cd946a1b (diff)
Don't send uninitialized memory over the network
-rw-r--r--src/engine/shared/network_server.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/engine/shared/network_server.cpp b/src/engine/shared/network_server.cpp
index 97d8dbc84..537048cbb 100644
--- a/src/engine/shared/network_server.cpp
+++ b/src/engine/shared/network_server.cpp
@@ -166,7 +166,7 @@ int CNetServer::Recv(CNetChunk *pChunk)
{
char aBuf[128];
str_format(aBuf, sizeof(aBuf), "Only %d players with the same IP are allowed", m_MaxClientsPerIP);
- CNetBase::SendControlMsg(m_Socket, &Addr, 0, NET_CTRLMSG_CLOSE, aBuf, sizeof(aBuf));
+ CNetBase::SendControlMsg(m_Socket, &Addr, 0, NET_CTRLMSG_CLOSE, aBuf, str_length(aBuf) + 1);
return 0;
}
}