CID 22563: Copy into fixed size buffer (STRING_OVERFLOW)

bsdstring to the rescue, once again
This commit is contained in:
Enno Rehling 2015-10-30 11:16:09 +01:00
parent 0de6e5ecb8
commit ca7d25858e
1 changed files with 3 additions and 1 deletions

View File

@ -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);