mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-03 22:58:50 +00:00
Merge pull request #9754 from JosJuice/netplay-memcard-region
NetPlay: Check that memory card region is valid
This commit is contained in:
commit
52a388af9a
1 changed files with 7 additions and 0 deletions
|
@ -859,6 +859,13 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||||
bool mc251;
|
bool mc251;
|
||||||
packet >> is_slot_a >> region >> mc251;
|
packet >> is_slot_a >> region >> mc251;
|
||||||
|
|
||||||
|
// This check is mainly intended to filter out characters which have special meanings in paths
|
||||||
|
if (region != JAP_DIR && region != USA_DIR && region != EUR_DIR)
|
||||||
|
{
|
||||||
|
SyncSaveDataResponse(false);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const std::string path = File::GetUserPath(D_GCUSER_IDX) + GC_MEMCARD_NETPLAY +
|
const std::string path = File::GetUserPath(D_GCUSER_IDX) + GC_MEMCARD_NETPLAY +
|
||||||
(is_slot_a ? "A." : "B.") + region + (mc251 ? ".251" : "") + ".raw";
|
(is_slot_a ? "A." : "B.") + region + (mc251 ? ".251" : "") + ".raw";
|
||||||
if (File::Exists(path) && !File::Delete(path))
|
if (File::Exists(path) && !File::Delete(path))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue