Skip to content

Commit

Permalink
Fixed crash on Linux caused by buffer overflow in snprintf call
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrossherron committed Apr 22, 2024
1 parent 654e815 commit 8d20fb1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions FEBio/FEBioApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ bool FEBioApp::ParseCmdLine(int nargs, char* argv[])
// set initial configuration file name
if (ops.szcnf[0] == 0)
{
char szpath[1024] = { 0 };
febio::get_app_path(szpath, 1023);
snprintf(ops.szcnf, 1024, "%sfebio.xml", szpath);
char szpath[512] = { 0 };
febio::get_app_path(szpath, 511);
snprintf(ops.szcnf, 512, "%sfebio.xml", szpath);
}

// loop over the arguments
Expand Down

0 comments on commit 8d20fb1

Please sign in to comment.