From 0de6e5ecb8bbf4f19d6d646d64d469d139b22cd9 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 30 Oct 2015 11:13:48 +0100 Subject: [PATCH] CID 22564: Copy into fixed size buffer (STRING_OVERFLOW) buffer sizes => bsdstring.h --- src/reports.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/reports.c b/src/reports.c index ce66d273f..ae965c938 100644 --- a/src/reports.c +++ b/src/reports.c @@ -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);