diff --git a/src/RageFileManager.cpp b/src/RageFileManager.cpp index 7e783ad1d4..33d126b908 100644 --- a/src/RageFileManager.cpp +++ b/src/RageFileManager.cpp @@ -349,6 +349,12 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector &Add { RString sPath = sPath_; NormalizePath( sPath ); + + // NormalizePath() calls CollapsePath() which will remove "dir/.." pairs. + // So if a "/.." is still present, they're trying to go below the mountpoint, + // which isn't valid. + if( sPath.find("/..") != std::string::npos ) + return; vector apDriverList; ReferenceAllDrivers( apDriverList );