mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-24 09:00:49 +02:00
EmulatedFiles: Don't crash on too long paths
This commit is contained in:
1 parent
ad13c82918
commit
abcdff6a50
1 file changed
+6
-1
@@ -612,7 +612,12 @@ namespace FEXCore::EmulatedFile {
|
||||
}
|
||||
|
||||
int32_t EmulatedFDManager::OpenAt(int dirfs, const char *pathname, int flags, uint32_t mode) {
|
||||
string cpath = std::filesystem::exists(pathname) ? std::filesystem::canonical(pathname)
|
||||
std::error_code ec;
|
||||
bool exists = std::filesystem::exists(pathname, ec);
|
||||
if (ec) {
|
||||
return -1;
|
||||
}
|
||||
string cpath = exists ? std::filesystem::canonical(pathname)
|
||||
: std::filesystem::path(pathname).lexically_normal(); // *Note: this doesn't transform to absolute
|
||||
|
||||
if (EmulatedMap.find(cpath) == EmulatedMap.end()) {
|
||||
|
||||
Reference in new issue
Block a user