Skip to content

Commit

Permalink
Safety net (suggested by @gfgtdf)
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Oct 24, 2018
1 parent 165f2cd commit 31465c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/filesystem.cpp
Expand Up @@ -1266,7 +1266,7 @@ static bool is_legal_file(const std::string& filename_str)
return false;
}

if (filename.size() >= 2 && filename[0] == '.' && filename[1] == '.') {
if(filename.find("..") != std::string::npos) {
ERR_FS << "Illegal path '" << filename << "' (initial \"..\" not allowed).\n";
return false;
}
Expand Down

0 comments on commit 31465c4

Please sign in to comment.