Use strncpy instead of strcpy because again, buffer overflows

This commit is contained in:
Glenn Smith 2018-03-06 01:59:05 -05:00
parent 7769da9434
commit 79c34c68db
92 changed files with 298 additions and 279 deletions

View file

@ -128,7 +128,7 @@
const char *rmtCommandName = dStrchr(mArgv[1], ' ') + 1;
if(conn->isConnectionToServer())
{
dStrcpy(mBuf, "clientCmd");
dStrcpy(mBuf, "clientCmd", 1024);
dStrcat(mBuf, rmtCommandName, 1024);
char *temp = mArgv[1];
@ -139,7 +139,7 @@
}
else
{
dStrcpy(mBuf, "serverCmd");
dStrcpy(mBuf, "serverCmd", 1024);
dStrcat(mBuf, rmtCommandName, 1024);
char *temp = mArgv[1];
@ -409,7 +409,7 @@ ConsoleFunction( buildTaggedString, const char*, 2, 11, "(string format, ...)"
S32 strLength = dStrlen(argStr);
if (strLength > strMaxLength)
goto done;
dStrcpy(strBufPtr, argStr);
dStrcpy(strBufPtr, argStr, strMaxLength);
strBufPtr += strLength;
strMaxLength -= strLength;
fmtStrPtr += 2;