Skip to content
Permalink
Browse files Browse the repository at this point in the history
Disallow inclusion of .pbl files from WML (bug #23504)
Note that this will also cause Lua wesnoth.have_file() to return false
on .pbl files.
  • Loading branch information
irydacea committed Jun 9, 2015
1 parent e2df198 commit f891446
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog
Expand Up @@ -65,6 +65,7 @@ Version 1.13.0+dev:
* Made silence.ogg larger to work around a crash involving the multiplayer
lobby with music and sound enabled (bug #23633, possibly also bug #23599,
bug #23203, bug #23026).
* Disallowed inclusion of .pbl files from WML (bug #23504).

Version 1.13.0:
* Security fixes:
Expand Down
5 changes: 5 additions & 0 deletions src/filesystem.cpp
Expand Up @@ -1008,6 +1008,11 @@ std::string get_wml_location(const std::string &filename, const std::string &cur
return result;
}

if (ends_with(filename, ".pbl")) {
ERR_FS << "Illegal path '" << filename << "' (.pbl files are not allowed)." << std::endl;
return result;
}

bool already_found = false;

if (filename[0] == '~')
Expand Down
5 changes: 5 additions & 0 deletions src/filesystem_boost.cpp
Expand Up @@ -1000,6 +1000,11 @@ static bool is_legal_file(const std::string &filename)
return false;
}

if (ends_with(filename, ".pbl")) {
ERR_FS << "Illegal path '" << filename << "' (.pbl files are not allowed)." << std::endl;
return false;
}

return true;
}

Expand Down

0 comments on commit f891446

Please sign in to comment.