mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-11 22:49:55 +00:00
sys_fs: fix potential OOB write
This commit is contained in:
@@ -1140,7 +1140,12 @@ error_code sys_fs_test(ppu_thread&, u32 arg1, u32 arg2, vm::ptr<u32> arg3, u32 a
|
||||
}
|
||||
}
|
||||
|
||||
buf[buf_size - 1] = 0;
|
||||
// TODO: maybe buf_size == 0 returns an error ?
|
||||
if (buf_size > 0)
|
||||
{
|
||||
buf[buf_size - 1] = 0;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user