From ca7d25858e8e57a88912524375d14f029cd8e23e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 30 Oct 2015 11:16:09 +0100 Subject: [PATCH] CID 22563: Copy into fixed size buffer (STRING_OVERFLOW) bsdstring to the rescue, once again --- src/laws.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/laws.c b/src/laws.c index 2fd9ce1d8..ca2e8a8ef 100755 --- a/src/laws.c +++ b/src/laws.c @@ -4513,7 +4513,9 @@ void update_subscriptions(void) FILE *F; char zText[MAX_PATH]; faction *f; - strcat(strcpy(zText, basepath()), "/subscriptions"); + + strlcpy(zText, basepath(), sizeof(zText)); + strlcat(zText, "/subscriptions", sizeof(zText)); F = fopen(zText, "r"); if (F == NULL) { log_warning(0, "could not open %s.\n", zText);