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

@ -182,8 +182,8 @@ void Force::init()
if (pair_restart) {
if (!pair) {
char msg[128];
sprintf(msg,"Must re-specify non-restarted pair style (%s) "
"after read_restart", pair_restart);
snprintf(msg,128,"Must re-specify non-restarted pair style (%s) "
"after read_restart", pair_restart);
error->all(FLERR,msg);
}
}