From d5bb4128dea367f7b020cadfdd5347eabec7bf05 Mon Sep 17 00:00:00 2001 From: Acts1631 Date: Thu, 1 Oct 2026 10:24:25 -0400 Subject: [PATCH] Validate GGPO VF4 card events A connected peer can send a VF4 card event with an arbitrary player number. The handler used it to index beyond the global MapleDevices array. Require a complete card event and restrict the player number to the two players supported by the GGPO session. --- core/network/ggpo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/network/ggpo.cpp b/core/network/ggpo.cpp index 64218ffc49..384e645e4f 100644 --- a/core/network/ggpo.cpp +++ b/core/network/ggpo.cpp @@ -468,7 +468,9 @@ static void on_message(u8 *msg, int len) break; case GameEvent::VF4Card: - setRfidCardData(event->u.card.playerNum, event->u.card.data); + if (len == sizeof(event->type) + sizeof(event->u.card) + && event->u.card.playerNum < MAX_PLAYERS) + setRfidCardData(event->u.card.playerNum, event->u.card.data); break; default: