summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-02-27 15:42:59 +0100
committerGitHub <noreply@github.com>2024-02-27 15:42:59 +0100
commit30567a590935bcb67af67cf2892c1bbcff6e6832 (patch)
treedb59762baee45e5cddb5ae89026250c81a5c4f76 /src
parentMerge pull request #13171 from liamwhite/fake-address (diff)
parentgeneral: fix asan errors (diff)
downloadyuzu-30567a590935bcb67af67cf2892c1bbcff6e6832.tar
yuzu-30567a590935bcb67af67cf2892c1bbcff6e6832.tar.gz
yuzu-30567a590935bcb67af67cf2892c1bbcff6e6832.tar.bz2
yuzu-30567a590935bcb67af67cf2892c1bbcff6e6832.tar.lz
yuzu-30567a590935bcb67af67cf2892c1bbcff6e6832.tar.xz
yuzu-30567a590935bcb67af67cf2892c1bbcff6e6832.tar.zst
yuzu-30567a590935bcb67af67cf2892c1bbcff6e6832.zip
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/fssystem/fssystem_aes_xts_storage.cpp4
-rw-r--r--src/core/hle/service/server_manager.cpp14
2 files changed, 12 insertions, 6 deletions
diff --git a/src/core/file_sys/fssystem/fssystem_aes_xts_storage.cpp b/src/core/file_sys/fssystem/fssystem_aes_xts_storage.cpp
index 022424229..efc5aa0b1 100644
--- a/src/core/file_sys/fssystem/fssystem_aes_xts_storage.cpp
+++ b/src/core/file_sys/fssystem/fssystem_aes_xts_storage.cpp
@@ -31,8 +31,8 @@ AesXtsStorage::AesXtsStorage(VirtualFile base, const void* key1, const void* key
ASSERT(iv_size == IvSize);
ASSERT(Common::IsAligned(m_block_size, AesBlockSize));
- std::memcpy(m_key.data() + 0, key1, KeySize);
- std::memcpy(m_key.data() + 0x10, key2, KeySize);
+ std::memcpy(m_key.data() + 0, key1, KeySize / 2);
+ std::memcpy(m_key.data() + 0x10, key2, KeySize / 2);
std::memcpy(m_iv.data(), iv, IvSize);
m_cipher.emplace(m_key, Core::Crypto::Mode::XTS);
diff --git a/src/core/hle/service/server_manager.cpp b/src/core/hle/service/server_manager.cpp
index 0b41bbcb9..3d898725e 100644
--- a/src/core/hle/service/server_manager.cpp
+++ b/src/core/hle/service/server_manager.cpp
@@ -93,13 +93,19 @@ ServerManager::~ServerManager() {
m_threads.clear();
// Clean up ports.
- for (auto it = m_servers.begin(); it != m_servers.end(); it = m_servers.erase(it)) {
- delete std::addressof(*it);
+ auto port_it = m_servers.begin();
+ while (port_it != m_servers.end()) {
+ auto* const port = std::addressof(*port_it);
+ port_it = m_servers.erase(port_it);
+ delete port;
}
// Clean up sessions.
- for (auto it = m_sessions.begin(); it != m_sessions.end(); it = m_sessions.erase(it)) {
- delete std::addressof(*it);
+ auto session_it = m_sessions.begin();
+ while (session_it != m_sessions.end()) {
+ auto* const session = std::addressof(*session_it);
+ session_it = m_sessions.erase(session_it);
+ delete session;
}
// Close wakeup event.