Fix opening /vol/content when redirecting it to a specfic path

This commit is contained in:
Maschell 2021-09-30 00:25:28 +02:00
parent bff0f823f0
commit b00a566726
1 changed files with 3 additions and 1 deletions

View File

@ -519,7 +519,9 @@ static inline void replaceContentPath(char *pathForCheck, int pathForCheckSize,
int subStrLen = strlen(pathForCheck) - skipLen;
if (subStrLen <= 0) {
pathForCheck[0] = '\0';
strncat(pathForCheck, replaceWith, sizeof(pathForCheck) - 1);
if (strlen(replaceWith) + 1 <= pathForCheckSize) {
memcpy(pathForCheck, replaceWith, strlen(replaceWith) + 1);
}
} else {
char pathCopy[subStrLen + 1];
pathCopy[0] = '\0';