mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-12-27 10:09:52 +00:00
fs: Return nullptr when file descriptor is out of bounds. (#1842)
This commit is contained in:
parent
08182f814f
commit
7e890def48
|
@ -171,6 +171,9 @@ void HandleTable::DeleteHandle(int d) {
|
|||
|
||||
File* HandleTable::GetFile(int d) {
|
||||
std::scoped_lock lock{m_mutex};
|
||||
if (d < 0 || d >= m_files.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
return m_files.at(d);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue