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

View File

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