From 208068486dad2f6e4d1f9e9d7d855f7ccc6fb179 Mon Sep 17 00:00:00 2001 From: Travis Wehrman Date: Sun, 10 Sep 2017 19:15:41 -0500 Subject: [PATCH] Fixed bug in CCommand constructor that could append junk to the command string * Missed copying the null terminator * Since m_pArgSBuffer is not initialized this problem can occur when the (command string buffer length) + 1 char in m_pArgSBuffer array happens to be non-zero. --- mp/src/tier1/convar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mp/src/tier1/convar.cpp b/mp/src/tier1/convar.cpp index 772586f2e3..adc41f5185 100644 --- a/mp/src/tier1/convar.cpp +++ b/mp/src/tier1/convar.cpp @@ -359,7 +359,7 @@ CCommand::CCommand( int nArgC, const char **ppArgV ) { *pSBuf++ = '\"'; } - memcpy( pSBuf, ppArgV[i], nLen ); + memcpy( pSBuf, ppArgV[i], nLen+1 ); pSBuf += nLen; if ( bContainsSpace ) {