[XAM] Fixed potential use-after-free on profile login
This commit is contained in:
@@ -278,10 +278,11 @@ void ProfileManager::Login(const uint64_t xuid, const uint8_t user_index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find if xuid is already logged in. We might want to logout.
|
// Find if xuid is already logged in. We might want to logout.
|
||||||
for (auto& logged_profile : logged_profiles_) {
|
auto it = std::find_if(
|
||||||
if (logged_profile.second->xuid() == xuid) {
|
logged_profiles_.begin(), logged_profiles_.end(),
|
||||||
Logout(logged_profile.first);
|
[xuid](const auto& entry) { return entry.second->xuid() == xuid; });
|
||||||
}
|
if (it != logged_profiles_.end()) {
|
||||||
|
Logout(it->first);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!accounts_.count(xuid)) {
|
if (!accounts_.count(xuid)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user