diff --git a/network/netplay/netplay_handshake.c b/network/netplay/netplay_handshake.c index 2adf2d20ed..8cb768160a 100644 --- a/network/netplay/netplay_handshake.c +++ b/network/netplay/netplay_handshake.c @@ -771,7 +771,7 @@ bool netplay_handshake_pre_info(netplay_t *netplay, uint32_t *content_crc_ptr; const char *dmsg = NULL; - RECV(&info_buf, sizeof(info_buf)) {} + RECV(&info_buf, sizeof(info_buf.cmd)) {} if (recvd < 0 || ntohl(info_buf.cmd[0]) != NETPLAY_CMD_INFO) @@ -800,6 +800,12 @@ bool netplay_handshake_pre_info(netplay_t *netplay, return true; } + RECV(&info_buf.core_name, cmd_size) + { + RARCH_ERR("Failed to receive netplay info payload.\n"); + return false; + } + /* Check the core info */ core_info = NULL; runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &core_info);