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

@ -121,6 +121,7 @@ void Memory::sfree(void *ptr)
void Memory::fail(const char *name)
{
char str[128];
sprintf(str,"Cannot create/grow a vector/array of pointers for %s",name);
snprintf(str,128,
"Cannot create/grow a vector/array of pointers for %s",name);
error->one(FLERR,str);
}