From 43abb22c0626529c8465f25bd62b813898abe840 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Jan 2018 22:03:51 +0300 Subject: Dont allow use realpath function if in path present "(unreachable)". Possible glibc bug mitigation. --- src/fs/paths.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/fs/paths.cpp') diff --git a/src/fs/paths.cpp b/src/fs/paths.cpp index 31052b7bb..db9742daf 100644 --- a/src/fs/paths.cpp +++ b/src/fs/paths.cpp @@ -75,6 +75,10 @@ namespace std::string getRealPath(const std::string &str) { +#if defined(__GLIBC__) + if (str.find("(unreachable)") != std::string::npos) + return ""; +#endif // defined(__GLIBC__) #if defined(__OpenBSD__) || defined(__ANDROID__) || defined(__native_client__) char *realPath = reinterpret_cast(calloc(PATH_MAX, sizeof(char))); if (!realPath) -- cgit v1.2.3-60-g2f50