Permalink
Browse files

Don't send uninitialized memory over the network

  • Loading branch information...
1 parent 093c1f1 commit 7dd463d1178e0c1277b5ae6cf0841a0f68e2408b @heinrich5991 heinrich5991 committed with oy May 23, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;
}
}

0 comments on commit 7dd463d

Please sign in to comment.