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