mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
Improve ELF/Trophy loader's error checking
This commit is contained in:
parent
a67b347966
commit
2f333424a6
6 changed files with 61 additions and 53 deletions
|
@ -1556,6 +1556,17 @@ bool fs::dir::open(const std::string& path)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool fs::file::strict_read_check(u64 _size, u64 type_size) const
|
||||
{
|
||||
if (usz pos0 = pos(), size0 = size(); pos0 >= size0 || (size0 - pos0) / type_size < _size)
|
||||
{
|
||||
fs::g_tls_error = fs::error::inval;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::string& fs::get_config_dir()
|
||||
{
|
||||
// Use magic static
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue