diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-01-13 22:03:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-01-13 22:04:26 +0300 |
commit | 43abb22c0626529c8465f25bd62b813898abe840 (patch) | |
tree | f471752b2b696e0ed3d4747fae859ecbd21bf674 /src | |
parent | 1b9913feb9541fc8a013b372bab1f77f4f9aca73 (diff) | |
download | manaverse-43abb22c0626529c8465f25bd62b813898abe840.tar.gz manaverse-43abb22c0626529c8465f25bd62b813898abe840.tar.bz2 manaverse-43abb22c0626529c8465f25bd62b813898abe840.tar.xz manaverse-43abb22c0626529c8465f25bd62b813898abe840.zip |
Dont allow use realpath function if in path present "(unreachable)".
Possible glibc bug mitigation.
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/paths.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<char*>(calloc(PATH_MAX, sizeof(char))); if (!realPath) |