summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-07-21 20:02:40 +0200
committerSubv <subv2112@gmail.com>2017-07-21 21:59:21 +0200
commit2dc720c355dad55a607c1f993fc823cc198bed08 (patch)
tree9a4be495c430689a33c041959e5f15c971a4669e /src/core/hle
parentServices/APT: Use boost::optional for the APT parameter structure. (diff)
downloadyuzu-2dc720c355dad55a607c1f993fc823cc198bed08.tar
yuzu-2dc720c355dad55a607c1f993fc823cc198bed08.tar.gz
yuzu-2dc720c355dad55a607c1f993fc823cc198bed08.tar.bz2
yuzu-2dc720c355dad55a607c1f993fc823cc198bed08.tar.lz
yuzu-2dc720c355dad55a607c1f993fc823cc198bed08.tar.xz
yuzu-2dc720c355dad55a607c1f993fc823cc198bed08.tar.zst
yuzu-2dc720c355dad55a607c1f993fc823cc198bed08.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/apt/apt.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp
index e4068926a..b5748693f 100644
--- a/src/core/hle/service/apt/apt.cpp
+++ b/src/core/hle/service/apt/apt.cpp
@@ -227,6 +227,20 @@ void ReceiveParameter(Service::Interface* self) {
"buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
buffer_size, static_buff_size);
+ if (!next_parameter) {
+ IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
+ rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet,
+ ErrorSummary::InvalidState, ErrorLevel::Status));
+ return;
+ }
+
+ if (next_parameter->destination_id != app_id) {
+ IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
+ rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound,
+ ErrorLevel::Status));
+ return;
+ }
+
IPC::RequestBuilder rb = rp.MakeBuilder(4, 4);
rb.Push(RESULT_SUCCESS); // No error
@@ -259,6 +273,20 @@ void GlanceParameter(Service::Interface* self) {
"buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
buffer_size, static_buff_size);
+ if (!next_parameter) {
+ IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
+ rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet,
+ ErrorSummary::InvalidState, ErrorLevel::Status));
+ return;
+ }
+
+ if (next_parameter->destination_id != app_id) {
+ IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
+ rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound,
+ ErrorLevel::Status));
+ return;
+ }
+
IPC::RequestBuilder rb = rp.MakeBuilder(4, 4);
rb.Push(RESULT_SUCCESS); // No error
rb.Push(next_parameter->sender_id);