mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
SI_DeviceAMBaseboard: Add missing bounds checks
VolumeDisc: Fix Triforce's GetGameID memcpy by checking MakerID's size
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -258,8 +258,8 @@ private:
|
||||
u8 m_last[2][0x80] = {};
|
||||
u32 m_lastptr[2] = {};
|
||||
|
||||
u16 m_coin[2] = {};
|
||||
u32 m_coin_pressed[2] = {};
|
||||
std::array<u16, 2> m_coin{};
|
||||
std::array<u32, 2> m_coin_pressed{};
|
||||
|
||||
u8 m_ic_card_data[2048] = {};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace DiscIO
|
||||
{
|
||||
std::string VolumeDisc::GetGameID(const Partition& partition) const
|
||||
{
|
||||
char id[6];
|
||||
char id[6]{};
|
||||
|
||||
if (GetVolumeType() == Platform::Triforce)
|
||||
{
|
||||
@@ -47,7 +47,8 @@ std::string VolumeDisc::GetGameID(const Partition& partition) const
|
||||
break;
|
||||
}
|
||||
|
||||
memcpy(id + 4, GetMakerID().c_str(), 2);
|
||||
const std::string maker_id{GetMakerID()};
|
||||
memcpy(id + 4, maker_id.c_str(), std::min<std::size_t>(maker_id.size(), 2));
|
||||
|
||||
return DecodeString(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user