CID 22564: Copy into fixed size buffer (STRING_OVERFLOW)

buffer sizes => bsdstring.h
This commit is contained in:
Enno Rehling 2015-10-30 11:13:48 +01:00
parent df82a9795d
commit 0de6e5ecb8
1 changed files with 4 additions and 3 deletions

View File

@ -1621,9 +1621,10 @@ static void write_script(FILE * F, const faction * f)
buf[0] = 0;
for (rtype = report_types; rtype != NULL; rtype = rtype->next) {
if (f->options & rtype->flag) {
if (buf[0])
strcat(buf, ",");
strcat(buf, rtype->extension);
if (buf[0]) {
strlcat(buf, ",", sizeof(buf));
}
strlcat(buf, rtype->extension, sizeof(buf));
}
}
fputs(buf, F);