summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-02-28 01:46:10 +0100
committerGitHub <noreply@github.com>2023-02-28 01:46:10 +0100
commit22432668be6d34b5a5275bcc631cadf512f36bf9 (patch)
tree88aeebd3448ad8fa701914839c0b1f3c876c62ac /src/core/hle/service/am
parentMerge pull request #9874 from german77/violet (diff)
parentam: avoid direct pointer access of transfer memory objects (diff)
downloadyuzu-22432668be6d34b5a5275bcc631cadf512f36bf9.tar
yuzu-22432668be6d34b5a5275bcc631cadf512f36bf9.tar.gz
yuzu-22432668be6d34b5a5275bcc631cadf512f36bf9.tar.bz2
yuzu-22432668be6d34b5a5275bcc631cadf512f36bf9.tar.lz
yuzu-22432668be6d34b5a5275bcc631cadf512f36bf9.tar.xz
yuzu-22432668be6d34b5a5275bcc631cadf512f36bf9.tar.zst
yuzu-22432668be6d34b5a5275bcc631cadf512f36bf9.zip
Diffstat (limited to 'src/core/hle/service/am')
-rw-r--r--src/core/hle/service/am/am.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 26af499d2..9a7316e27 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1264,9 +1264,8 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
return;
}
- const u8* const mem_begin = system.Memory().GetPointer(transfer_mem->GetSourceAddress());
- const u8* const mem_end = mem_begin + transfer_mem->GetSize();
- std::vector<u8> memory{mem_begin, mem_end};
+ std::vector<u8> memory(transfer_mem->GetSize());
+ system.Memory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), memory.size());
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
@@ -1298,9 +1297,8 @@ void ILibraryAppletCreator::CreateHandleStorage(Kernel::HLERequestContext& ctx)
return;
}
- const u8* const mem_begin = system.Memory().GetPointer(transfer_mem->GetSourceAddress());
- const u8* const mem_end = mem_begin + transfer_mem->GetSize();
- std::vector<u8> memory{mem_begin, mem_end};
+ std::vector<u8> memory(transfer_mem->GetSize());
+ system.Memory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), memory.size());
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);