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
|
|
@ -171,10 +171,11 @@ void afxSpellButton::setBitmap(const char *name, bool placeholder)
|
|||
|
||||
if (placeholder)
|
||||
{
|
||||
dStrcpy(buffer, name);
|
||||
dStrcpy(buffer, name, 1024);
|
||||
S32 pLen = 1024 - dStrlen(buffer);
|
||||
p = buffer + dStrlen(buffer);
|
||||
|
||||
dStrcpy(p, "_i");
|
||||
dStrcpy(p, "_i", pLen);
|
||||
mTextureInactive.set(buffer, COOLDOWN_PROFILE);
|
||||
mTextureNormal = mTextureInactive;
|
||||
mTextureHilight = mTextureInactive;
|
||||
|
|
@ -183,19 +184,20 @@ void afxSpellButton::setBitmap(const char *name, bool placeholder)
|
|||
}
|
||||
else
|
||||
{
|
||||
dStrcpy(buffer, name);
|
||||
dStrcpy(buffer, name, 1024);
|
||||
S32 pLen = 1024 - dStrlen(buffer);
|
||||
p = buffer + dStrlen(buffer);
|
||||
dStrcpy(p, "_n");
|
||||
dStrcpy(p, "_n", pLen);
|
||||
mTextureNormal.set(buffer, COOLDOWN_PROFILE);
|
||||
dStrcpy(p, "_h");
|
||||
dStrcpy(p, "_h", pLen);
|
||||
mTextureHilight.set(buffer, COOLDOWN_PROFILE);
|
||||
if (!mTextureHilight)
|
||||
mTextureHilight = mTextureNormal;
|
||||
dStrcpy(p, "_d");
|
||||
dStrcpy(p, "_d", pLen);
|
||||
mTextureDepressed.set(buffer, COOLDOWN_PROFILE);
|
||||
if (!mTextureDepressed)
|
||||
mTextureDepressed = mTextureHilight;
|
||||
dStrcpy(p, "_i");
|
||||
dStrcpy(p, "_i", pLen);
|
||||
mTextureInactive.set(buffer, COOLDOWN_PROFILE);
|
||||
if (!mTextureInactive)
|
||||
mTextureInactive = mTextureNormal;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue