From b00a56672688a71dbab060edcd945bc74c390125 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 30 Sep 2021 00:25:28 +0200 Subject: [PATCH] Fix opening /vol/content when redirecting it to a specfic path --- src/FSWrapper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/FSWrapper.cpp b/src/FSWrapper.cpp index 62ec7c9..234a34c 100644 --- a/src/FSWrapper.cpp +++ b/src/FSWrapper.cpp @@ -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';