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
1728fe39ad
commit
a94587af43
92 changed files with 298 additions and 279 deletions
|
|
@ -97,7 +97,7 @@ U32 NetStringTable::addString(const char *string)
|
|||
}
|
||||
table[e].refCount++;
|
||||
table[e].string = (char *) allocator->alloc(dStrlen(string) + 1);
|
||||
dStrcpy(table[e].string, string);
|
||||
dStrcpy(table[e].string, string, dStrlen(string) + 1);
|
||||
table[e].next = hashTable[bucket];
|
||||
hashTable[bucket] = e;
|
||||
table[e].link = firstValid;
|
||||
|
|
@ -179,7 +179,7 @@ void NetStringTable::repack()
|
|||
|
||||
|
||||
table[walk].string = (char *) newAllocator->alloc(dStrlen(prevStr) + 1);
|
||||
dStrcpy(table[walk].string, prevStr);
|
||||
dStrcpy(table[walk].string, prevStr, dStrlen(prevStr) + 1);
|
||||
}
|
||||
delete allocator;
|
||||
allocator = newAllocator;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue