mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-17 10:59:39 +00:00
Fix #2425
This commit is contained in:
1 parent
ee5d15c842
commit
7e2a173072
2 files changed
+12
-1
No files matched your search
@@ -17540,8 +17540,14 @@ TEST(SymlinkTest, SymlinkEscapeFromBaseDirectory) {
|
||||
}
|
||||
|
||||
// Create symlink using absolute path so it resolves correctly
|
||||
#ifdef PATH_MAX
|
||||
char abs_secret[PATH_MAX];
|
||||
ASSERT_NE(nullptr, realpath(secret_dir.c_str(), abs_secret));
|
||||
#else
|
||||
auto abs_secret = realpath(secret_dir.c_str(), nullptr);
|
||||
auto abs_secret_guard = detail::scope_exit([&]() { std::free(abs_secret); });
|
||||
ASSERT_NE(nullptr, abs_secret);
|
||||
#endif
|
||||
ASSERT_EQ(0, symlink(abs_secret, symlink_path.c_str()));
|
||||
|
||||
auto se = detail::scope_exit([&] {
|
||||
|
||||
Reference in new issue
Block a user