use snprintf() in a bunch of cases to avoid overflowing fixed size buffers with unchecked strings

This commit is contained in:
Axel Kohlmeyer
2018-09-06 02:57:53 -04:00
parent 0b951840f2
commit ca04e8f31c
16 changed files with 40 additions and 38 deletions

View File

@ -78,7 +78,7 @@ void FixEnforce2D::init()
flist[nfixlist++] = modify->fix[i];
else {
char msg[256];
sprintf(msg,"Fix enforce2d must be defined after fix %s",modify->fix[i]->style);
snprintf(msg,256,"Fix enforce2d must be defined after fix %s",modify->fix[i]->style);
error->all(FLERR,msg);
}
}