mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Use strncat instead of strcat to prevent some buffer overflows
This commit is contained in:
parent
53f35e7fb1
commit
7769da9434
32 changed files with 147 additions and 134 deletions
|
|
@ -967,10 +967,10 @@ void PersistenceManager::updateToken( const U32 lineNumber, const U32 linePositi
|
|||
|
||||
// Build the new line with the
|
||||
// preString + newValue + postString
|
||||
dStrcat(newLine, preString);
|
||||
dStrcat(newLine, preString, newLineLen);
|
||||
if ( newValue )
|
||||
dStrcat(newLine, newValue);
|
||||
dStrcat(newLine, postString);
|
||||
dStrcat(newLine, newValue, newLineLen);
|
||||
dStrcat(newLine, postString, newLineLen);
|
||||
|
||||
// Clear our existing line
|
||||
if (mLineBuffer[lineNumber])
|
||||
|
|
@ -1243,7 +1243,7 @@ PersistenceManager::ParsedObject* PersistenceManager::writeNewObject(SimObject*
|
|||
char* indent = getObjectIndent(parentObject);
|
||||
|
||||
if (parentObject)
|
||||
dStrcat(indent, " \0");
|
||||
dStrcat(indent, " \0", 2048);
|
||||
|
||||
// Write out the beginning of the object declaration
|
||||
const char* dclToken = "new";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue