Merge pull request #1108 from akohlmey/fix-sprintf-buffer-overflows

Avoid more buffer overflows due to using snprintf() on fixed size buffers
This commit is contained in:
Axel Kohlmeyer
2018-09-18 16:57:10 -04:00
committed by GitHub
106 changed files with 457 additions and 489 deletions

View File

@ -224,7 +224,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
fp = fopen(arg[iarg+1],"w");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open fix ave/chunk file %s",arg[iarg+1]);
snprintf(str,128,"Cannot open fix ave/chunk file %s",arg[iarg+1]);
error->one(FLERR,str);
}
}