diff --git a/cl_dll/MOTD.cpp b/cl_dll/MOTD.cpp index c48a9af1..1ca1c0f8 100644 --- a/cl_dll/MOTD.cpp +++ b/cl_dll/MOTD.cpp @@ -134,7 +134,8 @@ int CHudMOTD::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ) BEGIN_READ( pbuf, iSize ); int is_finished = READ_BYTE(); - strncat( m_szMOTD, READ_STRING(), sizeof(m_szMOTD) - 1 ); + strncat( m_szMOTD, READ_STRING(), sizeof(m_szMOTD) - strlen(m_szMOTD) - 1 ); + m_szMOTD[sizeof(m_szMOTD) - 1] = '\0'; if( is_finished ) { diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index 1dbb0b39..b4a6539c 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -173,6 +173,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu char killedwith[32]; strcpy( killedwith, "d_" ); strncat( killedwith, READ_STRING(), sizeof(killedwith) - strlen(killedwith) - 1 ); + killedwith[sizeof(killedwith) - 1] = '\0'; #if USE_VGUI if (gViewPort)