mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
sys_fs: Non-existant overflow bugfix
It would technically never overflow.. but this add minimal protection against adding beyond [PPU thread-count + entries count] This does not induce an atomic loop which limits until entries.size() but is slower.
This commit is contained in:
parent
faabb9e111
commit
02aac2c52e
1 changed files with 3 additions and 1 deletions
|
@ -384,7 +384,9 @@ struct lv2_dir final : lv2_fs_object
|
|||
// Read next
|
||||
const fs::dir_entry* dir_read()
|
||||
{
|
||||
if (const u64 cur = pos++; cur < entries.size())
|
||||
const u64 old_pos = pos;
|
||||
|
||||
if (const u64 cur = (old_pos < entries.size() ? pos++ : old_pos); cur < entries.size())
|
||||
{
|
||||
return &entries[cur];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue