diff options
| author | Dentomologist <dentomologist@gmail.com> | 2025-09-05 17:23:39 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2025-09-05 17:23:39 -0700 |
| commit | 85a89eb4200e028b601b1a950eba4479c6018229 (patch) | |
| tree | 856b4f42543537109731d3390054e20b0f0a6ec6 | |
| parent | 489952cf89241dd1d4c619b7066a91194eea6420 (diff) | |
RetroAchievements: Avoid uninitialized memory access
Avoid creating and then destroying a leaderboard list when game is null,
as doing so causes an access to uninitialized memory due to a bug in
rcheevos.
This can be triggered by starting a game with an invalid or expired
login token.
| -rw-r--r-- | Source/Core/Core/AchievementManager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp index aa8f0b1321..a361d5bf1b 100644 --- a/Source/Core/Core/AchievementManager.cpp +++ b/Source/Core/Core/AchievementManager.cpp @@ -1027,6 +1027,9 @@ void AchievementManager::LoadGameCallback(int result, const char* error_message, OSD::Color::RED); } + if (game == nullptr) + return; + rc_client_set_read_memory_function(instance.m_client, MemoryPeeker); instance.FetchGameBadges(); instance.m_system.store(&Core::System::GetInstance(), std::memory_order_release); |
