mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-03 03:03:50 +01:00
GetBlockTag() dereferenced GetBlockFromAddress()'s result without a null check, unlike every other accessor in this file. Callers (NetAdhocCommon.cpp, sceNet.cpp, sceNetAdhocMatching.cpp) pass the result straight into strcmp() while recovering from a stale address left over from an old/corrupted savestate - precisely the situation where the address may no longer resolve to a block. Return "" instead of dereferencing a null block, so strcmp() simply reports a mismatch (correctly triggering those callers' recovery path) instead of crashing. DoState() read the saved block count directly from the savestate with no validation before looping that many times allocating Blocks - a corrupt/malicious savestate claiming an enormous count would drive an effectively unbounded allocation loop. Clamp it to how many block records could plausibly still fit in the remaining stream data.