diff options
author | bunnei <bunneidev@gmail.com> | 2021-05-19 04:52:52 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-21 06:41:52 +0200 |
commit | f4fe71c1c9e5f0c2eaa159f676efea3ae1953a22 (patch) | |
tree | c4c9818c0e443e514c774f35e8e3dff3ebb23e4c /src/core/hle/kernel/hle_ipc.cpp | |
parent | common: tree: Avoid a crash on nullptr dereference. (diff) | |
download | yuzu-f4fe71c1c9e5f0c2eaa159f676efea3ae1953a22.tar yuzu-f4fe71c1c9e5f0c2eaa159f676efea3ae1953a22.tar.gz yuzu-f4fe71c1c9e5f0c2eaa159f676efea3ae1953a22.tar.bz2 yuzu-f4fe71c1c9e5f0c2eaa159f676efea3ae1953a22.tar.lz yuzu-f4fe71c1c9e5f0c2eaa159f676efea3ae1953a22.tar.xz yuzu-f4fe71c1c9e5f0c2eaa159f676efea3ae1953a22.tar.zst yuzu-f4fe71c1c9e5f0c2eaa159f676efea3ae1953a22.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/hle_ipc.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 689f58cf6..9d069a78f 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp @@ -69,14 +69,10 @@ void HLERequestContext::ParseCommandBuffer(const KHandleTable& handle_table, u32 if (incoming) { // Populate the object lists with the data in the IPC request. for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_copy; ++handle) { - const u32 copy_handle{rp.Pop<Handle>()}; - copy_handles.push_back(copy_handle); - copy_objects.push_back(handle_table.GetObject(copy_handle).GetPointerUnsafe()); + incoming_copy_handles.push_back(rp.Pop<Handle>()); } for (u32 handle = 0; handle < handle_descriptor_header->num_handles_to_move; ++handle) { - const u32 move_handle{rp.Pop<Handle>()}; - move_handles.push_back(move_handle); - move_objects.push_back(handle_table.GetObject(move_handle).GetPointerUnsafe()); + incoming_move_handles.push_back(rp.Pop<Handle>()); } } else { // For responses we just ignore the handles, they're empty and will be populated when @@ -186,14 +182,14 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_t auto& owner_process = *requesting_thread.GetOwnerProcess(); auto& handle_table = owner_process.GetHandleTable(); - for (auto& object : copy_objects) { + for (auto& object : outgoing_copy_objects) { Handle handle{}; if (object) { R_TRY(handle_table.Add(&handle, object)); } cmd_buf[current_offset++] = handle; } - for (auto& object : move_objects) { + for (auto& object : outgoing_move_objects) { Handle handle{}; if (object) { R_TRY(handle_table.Add(&handle, object)); @@ -208,8 +204,8 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_t // TODO(Subv): This completely ignores C buffers. if (Session()->IsDomain()) { - current_offset = domain_offset - static_cast<u32>(domain_objects.size()); - for (const auto& object : domain_objects) { + current_offset = domain_offset - static_cast<u32>(outgoing_domain_objects.size()); + for (const auto& object : outgoing_domain_objects) { server_session->AppendDomainHandler(object); cmd_buf[current_offset++] = static_cast<u32_le>(server_session->NumDomainRequestHandlers()); |