Skip to content
Snippets Groups Projects
Commit 7e85c153 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Further fix to avoid potential buffer overflows

parent 5fd45761
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :
// with suffix equal to the replica id
char str_num[32], logFile[1024];
sprintf(str_num,".%d",universe->iworld);
strncpy(logFile,arg[i],1024);
strncpy(logFile,arg[i],1024-32);
strcat(logFile,str_num);
p->cmd("setLogFile",logFile);
next=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment