From e4276f2983cea8f459f1e572ff12e848a58252cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Thu, 19 Apr 2018 00:38:04 +0200 Subject: [PATCH] IOS/SO: Handle invalid GetInterfaceOpt requests --- Source/Core/Core/IOS/Network/IP/Top.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Core/IOS/Network/IP/Top.cpp b/Source/Core/Core/IOS/Network/IP/Top.cpp index a53d6d5baa..037cd95589 100644 --- a/Source/Core/Core/IOS/Network/IP/Top.cpp +++ b/Source/Core/Core/IOS/Network/IP/Top.cpp @@ -719,6 +719,12 @@ IPCCommandResult NetIPTop::HandleGetInterfaceOptRequest(const IOCtlVRequest& req const u32 param4 = Memory::Read_U32(request.io_vectors[1].address); u32 param5 = 0; + if (param != 0xfffe) + { + WARN_LOG(IOS_NET, "GetInterfaceOpt: received invalid request with param0=%08x", param); + return GetDefaultReply(-51); + } + if (request.io_vectors[0].size >= 8) { param5 = Memory::Read_U32(request.io_vectors[0].address + 4);