@@ -387,7 +387,7 @@ void DebugInit(int flags)
387387 pEnd--;
388388 }
389389
390- strcpy (theLogFileNamePrev, dirbuf);
390+ strlcpy (theLogFileNamePrev, dirbuf, ARRAY_SIZE (theLogFileNamePrev) );
391391 strlcat (theLogFileNamePrev, gAppPrefix , ARRAY_SIZE (theLogFileNamePrev));
392392 strlcat (theLogFileNamePrev, DEBUG_FILE_NAME_PREV, ARRAY_SIZE (theLogFileNamePrev));
393393 if (rts::ClientInstance::getInstanceId () > 1u )
@@ -397,7 +397,7 @@ void DebugInit(int flags)
397397 }
398398 strlcat (theLogFileNamePrev, " .txt" , ARRAY_SIZE (theLogFileNamePrev));
399399
400- strcpy (theLogFileName, dirbuf);
400+ strlcpy (theLogFileName, dirbuf, ARRAY_SIZE (theLogFileNamePrev) );
401401 strlcat (theLogFileName, gAppPrefix , ARRAY_SIZE (theLogFileNamePrev));
402402 strlcat (theLogFileName, DEBUG_FILE_NAME, ARRAY_SIZE (theLogFileNamePrev));
403403 if (rts::ClientInstance::getInstanceId () > 1u )
@@ -736,9 +736,9 @@ void ReleaseCrash(const char *reason)
736736 return ; // We are shutting down, and TheGlobalData has been freed. jba. [4/15/2003]
737737 }
738738
739- strcpy (prevbuf, TheGlobalData->getPath_UserData ().str ());
739+ strlcpy (prevbuf, TheGlobalData->getPath_UserData ().str (), ARRAY_SIZE (prevbuf ));
740740 strlcat (prevbuf, RELEASECRASH_FILE_NAME_PREV, ARRAY_SIZE (prevbuf));
741- strcpy (curbuf, TheGlobalData->getPath_UserData ().str ());
741+ strlcpy (curbuf, TheGlobalData->getPath_UserData ().str (), ARRAY_SIZE (curbuf ));
742742 strlcat (curbuf, RELEASECRASH_FILE_NAME, ARRAY_SIZE (curbuf));
743743
744744 remove (prevbuf);
@@ -825,9 +825,9 @@ void ReleaseCrashLocalized(const AsciiString& p, const AsciiString& m)
825825 char prevbuf[ _MAX_PATH ];
826826 char curbuf[ _MAX_PATH ];
827827
828- strcpy (prevbuf, TheGlobalData->getPath_UserData ().str ());
828+ strlcpy (prevbuf, TheGlobalData->getPath_UserData ().str (), ARRAY_SIZE (prevbuf ));
829829 strlcat (prevbuf, RELEASECRASH_FILE_NAME_PREV, ARRAY_SIZE (prevbuf));
830- strcpy (curbuf, TheGlobalData->getPath_UserData ().str ());
830+ strlcpy (curbuf, TheGlobalData->getPath_UserData ().str (), ARRAY_SIZE (curbuf ));
831831 strlcat (curbuf, RELEASECRASH_FILE_NAME, ARRAY_SIZE (curbuf));
832832
833833 remove (prevbuf);
0 commit comments