Skip to content

Commit 3e782e0

Browse files
committed
fix case sensitivity of path sanitization
1 parent e4a9acb commit 3e782e0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

IntelPresentMon/AppCef/source/util/PathSanitaryCheck.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <algorithm>
55
#include <Core/source/infra/util/FolderResolver.h>
66
#include <Core/source/infra/Logging.h>
7+
#include <CommonUtilities/str/String.h>
78

89

910
namespace p2c::client::util
@@ -43,8 +44,9 @@ namespace p2c::client::util
4344
}
4445
bool PathSanitaryCheck(const std::filesystem::path& path, const std::filesystem::path& root)
4546
{
46-
const auto canonicalString = std::filesystem::weakly_canonical(path).wstring();
47-
const auto rootString = root.wstring();
48-
return canonicalString.starts_with(rootString);
47+
const auto canonicalString = pmon::util::str::ToLower(std::filesystem::weakly_canonical(path).wstring());
48+
const auto rootString = pmon::util::str::ToLower(root.wstring());
49+
const auto isSanitary = canonicalString.starts_with(rootString);
50+
return isSanitary;
4951
}
5052
}

0 commit comments

Comments
 (0)