[XAM] Fixed potantial crash while upserting setting related to missing SPA
- Fixed OOR asssertion caused by invalid amount of characters read by from_string
This commit is contained in:
@@ -451,15 +451,18 @@ struct GamerPictureKey {
|
|||||||
char small_tile_id[8];
|
char small_tile_id[8];
|
||||||
|
|
||||||
uint32_t GetTitleId() const {
|
uint32_t GetTitleId() const {
|
||||||
return string_util::from_string<uint32_t>(title_id, true);
|
return string_util::from_string<uint32_t>(
|
||||||
|
std::string(title_id, std::size(title_id)), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t GetBigTileId() const {
|
uint32_t GetBigTileId() const {
|
||||||
return string_util::from_string<uint32_t>(big_tile_id, true);
|
return string_util::from_string<uint32_t>(
|
||||||
|
std::string(big_tile_id, std::size(big_tile_id)), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t GetSmallTileId() const {
|
uint32_t GetSmallTileId() const {
|
||||||
return string_util::from_string<uint32_t>(small_tile_id, true);
|
return string_util::from_string<uint32_t>(
|
||||||
|
std::string(small_tile_id, std::size(small_tile_id)), true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
static_assert_size(GamerPictureKey, 0x18);
|
static_assert_size(GamerPictureKey, 0x18);
|
||||||
|
|||||||
@@ -734,7 +734,7 @@ void UserTracker::UpsertSetting(uint64_t xuid, uint32_t title_id,
|
|||||||
// Sometimes games like to ignore providing expicitly title_id, so we need to
|
// Sometimes games like to ignore providing expicitly title_id, so we need to
|
||||||
// check it.
|
// check it.
|
||||||
if (!title_id) {
|
if (!title_id) {
|
||||||
title_id = spa_data_->title_id();
|
title_id = spa_data_ ? spa_data_->title_id() : kernel_state()->title_id();
|
||||||
}
|
}
|
||||||
|
|
||||||
GpdInfo* info = user->GetGpd(title_id);
|
GpdInfo* info = user->GetGpd(title_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user