From 8f0aebcd4f4935221b1cb7b438161380447cceb1 Mon Sep 17 00:00:00 2001
From: zhupengfei <zhupf321@gmail.com>
Date: Sat, 28 Nov 2020 00:04:15 +0800
Subject: [PATCH] service/apt: Fix deliver arg hmac size

---
 src/core/hle/service/apt/apt.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp
index c0365b7c2..a22926a9c 100644
--- a/src/core/hle/service/apt/apt.cpp
+++ b/src/core/hle/service/apt/apt.cpp
@@ -532,7 +532,7 @@ void Module::APTInterface::ReceiveDeliverArg(Kernel::HLERequestContext& ctx) {
 
     auto arg = apt->applet_manager->ReceiveDeliverArg().value_or(AppletManager::DeliverArg{});
     arg.param.resize(param_size);
-    arg.hmac.resize(std::max<std::size_t>(hmac_size, 0x20));
+    arg.hmac.resize(std::min<std::size_t>(hmac_size, 0x20));
 
     IPC::RequestBuilder rb = rp.MakeBuilder(4, 4);
     rb.Push(RESULT_SUCCESS);