mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 03:44:32 +01:00
SaveState: Reject implausible event counts, ids and CPU speed from a state
They came straight from the file: a CPU frequency of 0 divided by zero, and counts or ids sized tables of up to tens of gigabytes, or tripped an assert. A file like that now fails to load like any other broken state. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
79d340f4fe
commit
eec6afaeca
2 files changed
+19
-1
No files matched your search
+2
-1
@@ -497,7 +497,8 @@ void HLEDoState(PointerWrap &p) {
|
||||
delete action;
|
||||
}
|
||||
mipsCallActions.clear();
|
||||
if (actions < 0) {
|
||||
// Each action takes at least its type id.
|
||||
if (actions < 0 || (size_t)actions > p.Remaining() / sizeof(int)) {
|
||||
p.SetError(p.ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user