Merge pull request from liamwhite/tmem-use

service: avoid direct pointer access of transfer memory objects
This commit is contained in:
liamwhite 2023-02-27 19:46:10 -05:00 committed by GitHub
commit 6825d636b1
21 changed files with 95 additions and 75 deletions
src/core/hle/service/am

View file

@ -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);