Engine was also using raw strcat/strcpy

This commit is contained in:
Glenn Smith 2018-03-07 00:49:46 -05:00
parent 751ccae12d
commit 25c25b20b1
4 changed files with 6 additions and 6 deletions

View file

@ -182,8 +182,8 @@ extern "C" {
void torque_setexecutablepath(const char* directory) void torque_setexecutablepath(const char* directory)
{ {
gExecutablePath = new char[strlen(directory)+1]; gExecutablePath = new char[dStrlen(directory)+1];
strcpy(gExecutablePath, directory); dStrcpy(gExecutablePath, directory, dStrlen(directory)+1);
} }
// set Torque 3D into web deployment mode (disable fullscreen exlusive mode, etc) // set Torque 3D into web deployment mode (disable fullscreen exlusive mode, etc)

View file

@ -33,7 +33,7 @@ bool fsTiXmlDocument::LoadFile( const char * pFilename, TiXmlEncoding encoding )
#ifdef TORQUE_OS_ANDROID #ifdef TORQUE_OS_ANDROID
if (strlen(pFilename) > strlen(filenameBuffer)) { if (strlen(pFilename) > strlen(filenameBuffer)) {
strcpy(filenameBuffer, pFilename); dStrcpy(filenameBuffer, pFilename, 1024);
} }
#endif #endif

View file

@ -53,7 +53,7 @@ bool TamlXmlParser::accept( const char* pFilename, TamlVisitor& visitor )
#ifdef TORQUE_OS_ANDROID #ifdef TORQUE_OS_ANDROID
if (strlen(pFilename) > strlen(filenameBuffer)) { if (strlen(pFilename) > strlen(filenameBuffer)) {
strcpy(filenameBuffer, pFilename); dStrcpy(filenameBuffer, pFilename, 1024);
} }
#endif #endif

View file

@ -523,7 +523,7 @@ next:
tblPkgID[j] = apicID & PackageIDMask; tblPkgID[j] = apicID & PackageIDMask;
sprintf(tmp," AffinityMask = %d; Initial APIC = %d; Physical ID = %d, Core ID = %d, SMT ID = %d\n", sprintf(tmp," AffinityMask = %d; Initial APIC = %d; Physical ID = %d, Core ID = %d, SMT ID = %d\n",
dwAffinityMask, apicID, tblPkgID[j], tblCoreID[j], tblSMTID[j]); dwAffinityMask, apicID, tblPkgID[j], tblCoreID[j], tblSMTID[j]);
strcat(g_s3Levels, tmp); dStrcat(g_s3Levels, tmp, 2048);
numLPEnabled ++; // Number of available logical processors in the system. numLPEnabled ++; // Number of available logical processors in the system.