@@ -381,6 +381,7 @@ void DebugInit(int flags)
381381 *(pEnd + 1 ) = 0 ;
382382 }
383383
384+ static_assert (ARRAY_SIZE (theLogFileNamePrev) >= ARRAY_SIZE (dirbuf), " Incorrect array size" );
384385 strcpy (theLogFileNamePrev, dirbuf);
385386 strlcat (theLogFileNamePrev, gAppPrefix , ARRAY_SIZE (theLogFileNamePrev));
386387 strlcat (theLogFileNamePrev, DEBUG_FILE_NAME_PREV, ARRAY_SIZE (theLogFileNamePrev));
@@ -391,6 +392,7 @@ void DebugInit(int flags)
391392 }
392393 strlcat (theLogFileNamePrev, " .txt" , ARRAY_SIZE (theLogFileNamePrev));
393394
395+ static_assert (ARRAY_SIZE (theLogFileName) >= ARRAY_SIZE (dirbuf), " Incorrect array size" );
394396 strcpy (theLogFileName, dirbuf);
395397 strlcat (theLogFileName, gAppPrefix , ARRAY_SIZE (theLogFileNamePrev));
396398 strlcat (theLogFileName, DEBUG_FILE_NAME, ARRAY_SIZE (theLogFileNamePrev));
@@ -730,9 +732,9 @@ void ReleaseCrash(const char *reason)
730732 return ; // We are shutting down, and TheGlobalData has been freed. jba. [4/15/2003]
731733 }
732734
733- strcpy (prevbuf, TheGlobalData->getPath_UserData ().str ());
735+ strlcpy (prevbuf, TheGlobalData->getPath_UserData ().str (), ARRAY_SIZE (prevbuf ));
734736 strlcat (prevbuf, RELEASECRASH_FILE_NAME_PREV, ARRAY_SIZE (prevbuf));
735- strcpy (curbuf, TheGlobalData->getPath_UserData ().str ());
737+ strlcpy (curbuf, TheGlobalData->getPath_UserData ().str (), ARRAY_SIZE (curbuf ));
736738 strlcat (curbuf, RELEASECRASH_FILE_NAME, ARRAY_SIZE (curbuf));
737739
738740 remove (prevbuf);
@@ -819,9 +821,9 @@ void ReleaseCrashLocalized(const AsciiString& p, const AsciiString& m)
819821 char prevbuf[ _MAX_PATH ];
820822 char curbuf[ _MAX_PATH ];
821823
822- strcpy (prevbuf, TheGlobalData->getPath_UserData ().str ());
824+ strlcpy (prevbuf, TheGlobalData->getPath_UserData ().str (), ARRAY_SIZE (prevbuf ));
823825 strlcat (prevbuf, RELEASECRASH_FILE_NAME_PREV, ARRAY_SIZE (prevbuf));
824- strcpy (curbuf, TheGlobalData->getPath_UserData ().str ());
826+ strlcpy (curbuf, TheGlobalData->getPath_UserData ().str (), ARRAY_SIZE (curbuf ));
825827 strlcat (curbuf, RELEASECRASH_FILE_NAME, ARRAY_SIZE (curbuf));
826828
827829 remove (prevbuf);
0 commit comments