Bounds check directories.

This commit is contained in:
Ben "root" Anderson
2014-02-09 08:26:11 -06:00
parent e085a40b01
commit ac8e92af17
+6
View File
@@ -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 );