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; buf[0] = 0;
for (rtype = report_types; rtype != NULL; rtype = rtype->next) { for (rtype = report_types; rtype != NULL; rtype = rtype->next) {
if (f->options & rtype->flag) { if (f->options & rtype->flag) {
if (buf[0]) if (buf[0]) {
strcat(buf, ","); strlcat(buf, ",", sizeof(buf));
strcat(buf, rtype->extension); }
strlcat(buf, rtype->extension, sizeof(buf));
} }
} }
fputs(buf, F); fputs(buf, F);