Bounds check directories.
This commit is contained in:
@@ -349,6 +349,12 @@ void RageFileManager::GetDirListing( const RString &sPath_, vector<RString> &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<LoadedDriver *> apDriverList;
|
||||
ReferenceAllDrivers( apDriverList );
|
||||
|
||||
Reference in New Issue
Block a user