sys_fs: fix potential OOB write

This commit is contained in:
Megamouse
2026-09-30 12:06:39 +03:00
committed by Elad
parent ad7c7a28aa
commit cf6c06eb66
+6 -1
View File
@@ -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;
}