aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2020-06-24 23:01:00 +1000
committerDavid Marcec <dmarcecguzman@gmail.com>2020-06-24 23:01:00 +1000
commitbf4e6b3cbac8d21357a4bb1d0827c515ff38c79c (patch)
tree57e45ffcf62e3b7d3729b73f3015faaa399b6e4d /src
parentba834728793d520df3da6b3a017a481d2387e1c7 (diff)
prepo: : Don't read extra buffer from report unless passed
Prepo doesn't always pass a secondary buffer, we assume it always does which leads to a bad read.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/prepo/prepo.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp
index 14309c6790..67833d9af6 100644
--- a/src/core/hle/service/prepo/prepo.cpp
+++ b/src/core/hle/service/prepo/prepo.cpp
@@ -75,8 +75,13 @@ private:
const auto user_id = rp.PopRaw<u128>();
const auto process_id = rp.PopRaw<u64>();
std::vector<std::vector<u8>> data{ctx.ReadBuffer(0)};
+
if constexpr (Type == Core::Reporter::PlayReportType::Old2) {
- data.emplace_back(ctx.ReadBuffer(1));
+ const auto read_buffer_count =
+ ctx.BufferDescriptorX().size() + ctx.BufferDescriptorA().size();
+ if (read_buffer_count > 1) {
+ data.emplace_back(ctx.ReadBuffer(1));
+ }
}
LOG_DEBUG(