use snprintf() in a bunch of cases to avoid overflowing fixed size buffers with unchecked strings
This commit is contained in:
@ -1632,7 +1632,7 @@ void Molecule::open(char *file)
|
||||
fp = fopen(file,"r");
|
||||
if (fp == NULL) {
|
||||
char str[128];
|
||||
sprintf(str,"Cannot open molecule file %s",file);
|
||||
snprintf(str,128,"Cannot open molecule file %s",file);
|
||||
error->one(FLERR,str);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user