mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Use strncpy instead of strcpy because again, buffer overflows
This commit is contained in:
parent
7769da9434
commit
79c34c68db
92 changed files with 298 additions and 279 deletions
|
|
@ -189,7 +189,7 @@ bool expandToolScriptFilename(char *filename, U32 size, const char *src)
|
|||
// Relative to script directory
|
||||
if(cbFullPath)
|
||||
{
|
||||
dStrcpy(varBuf, cbFullPath);
|
||||
dStrcpy(varBuf, cbFullPath, 1024);
|
||||
slash = dStrrchr(varBuf, '/');
|
||||
if(slash) *slash = 0;
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ bool expandOldScriptFilename(char *filename, U32 size, const char *src)
|
|||
const StringTableEntry cbName = CodeBlock::getCurrentCodeBlockName();
|
||||
if (!cbName)
|
||||
{
|
||||
dStrcpy(filename, src);
|
||||
dStrcpy(filename, src, size);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ bool expandOldScriptFilename(char *filename, U32 size, const char *src)
|
|||
*filename = 0;
|
||||
return false;
|
||||
}
|
||||
dStrcpy(filename, src);
|
||||
dStrcpy(filename, src, size);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ bool expandOldScriptFilename(char *filename, U32 size, const char *src)
|
|||
}
|
||||
|
||||
dStrncpy(filename, cbName, length);
|
||||
dStrcpy(filename+length, src+1);
|
||||
dStrcpy(filename+length, src+1, size - length);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue