From 742356338662a8d63503d9e806e01c7d8a9ed094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Thu, 17 Aug 2017 20:31:49 +0200 Subject: [PATCH] WFSI: Fix the TMD size check. --- Source/Core/Core/IOS/WFS/WFSI.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/Core/IOS/WFS/WFSI.cpp b/Source/Core/Core/IOS/WFS/WFSI.cpp index 519cc585c7..f65143f2bf 100644 --- a/Source/Core/Core/IOS/WFS/WFSI.cpp +++ b/Source/Core/Core/IOS/WFS/WFSI.cpp @@ -136,8 +136,7 @@ IPCCommandResult WFSI::IOCtl(const IOCtlRequest& request) INFO_LOG(IOS_WFS, "IOCTL_WFSI_PREPARE_DEVICE: patch type %d, continue install: %s", m_patch_type, m_continue_install ? "true" : "false"); - constexpr u32 MAX_TMD_SIZE = 0x4000; - if (tmd_size > MAX_TMD_SIZE) + if (!IOS::ES::IsValidTMDSize(tmd_size)) { ERROR_LOG(IOS_WFS, "IOCTL_WFSI_PREPARE_DEVICE: TMD size too large (%d)", tmd_size); return_error_code = IPC_EINVAL;