Use strncat instead of strcat to prevent some buffer overflows

This commit is contained in:
Glenn Smith 2018-03-06 00:48:44 -05:00
parent 53f35e7fb1
commit 7769da9434
32 changed files with 147 additions and 134 deletions

View file

@ -329,8 +329,8 @@ const char * Profiler::constructProfilePath(ProfilerData * pd)
U32 mark = FrameAllocator::getWaterMark();
char * buf = (char*)FrameAllocator::alloc(len+1);
dStrcpy(buf,pd->mParent->mPath);
dStrcat(buf,connector);
dStrcat(buf,pd->mRoot->mName);
dStrcat(buf,connector,len);
dStrcat(buf,pd->mRoot->mName,len);
const char * ret = StringTable->insert(buf);
FrameAllocator::setWaterMark(mark);